phasm/tests/integration/test_lang/test_static_array.py
Johan B.W. de Vries dcdd6aa6eb Ideas [skip-ci]
2025-04-13 13:57:08 +02:00

33 lines
667 B
Python

import pytest
from phasm.type3.entry import Type3Exception
from ..helpers import Suite
@pytest.mark.integration_test
def test_static_array_constant_too_few_values():
code_py = """
CONSTANT: u8[4] = (24, 57, )
@exported
def testEntry() -> i32:
return 0
"""
with pytest.raises(Type3Exception, match='Member count mismatch'):
Suite(code_py).run_code()
@pytest.mark.integration_test
def test_static_array_constant_too_many_values():
code_py = """
CONSTANT: u8[3] = (24, 57, 1, 1, )
@exported
def testEntry() -> i32:
return 0
"""
with pytest.raises(Type3Exception, match='Member count mismatch'):
Suite(code_py).run_code()