Extended the import example a bit for sanity's sake

This commit is contained in:
Johan B.W. de Vries 2022-07-09 11:34:20 +02:00
parent 76d80f57cb
commit c181c61040

View File

@ -421,16 +421,16 @@ def testEntry() -> i32x4:
def test_imported(): def test_imported():
code_py = """ code_py = """
@imported @imported
def helper() -> i32: def helper(mul: i32) -> i32:
pass pass
@exported @exported
def testEntry() -> i32: def testEntry() -> i32:
return helper() return helper(2)
""" """
def helper() -> int: def helper(mul: int) -> int:
return 4238 return 4238 * mul
result = Suite(code_py, 'test_imported').run_code( result = Suite(code_py, 'test_imported').run_code(
runtime='wasmer', runtime='wasmer',
@ -439,4 +439,4 @@ def testEntry() -> i32:
} }
) )
assert 4238 == result.returned_value assert 8476 == result.returned_value