21 lines
450 B
Python
21 lines
450 B
Python
import pytest
|
|
|
|
from ..helpers import Suite
|
|
|
|
|
|
@pytest.mark.integration_test
|
|
@pytest.mark.parametrize('type_, in_put, exp_result', [
|
|
('bytes', b'Hello, world!', 13),
|
|
# ('u8[4]', (1, 2, 3, 4), 4), # FIXME: Implement this
|
|
])
|
|
def test_len(type_, in_put, exp_result):
|
|
code_py = f"""
|
|
@exported
|
|
def testEntry(f: {type_}) -> u32:
|
|
return len(f)
|
|
"""
|
|
|
|
result = Suite(code_py).run_code(in_put)
|
|
|
|
assert exp_result == result.returned_value
|