phasm/tests/integration/test_lang/test_floating.py
2023-11-15 11:59:59 +01:00

18 lines
369 B
Python

import pytest
from ..helpers import Suite
@pytest.mark.integration_test
@pytest.mark.parametrize('type_', ['f32', 'f64'])
def test_builtins_sqrt(type_):
code_py = f"""
@exported
def testEntry() -> {type_}:
return sqrt(25.0)
"""
result = Suite(code_py).run_code()
assert 5 == result.returned_value
assert isinstance(result.returned_value, float)