Johan B.W. de Vries 8db541dc08 Moves the prelude to runtime
Previously, it was hardcoded at 'compile' time (in as much
Python has that). This would make it more difficult to add
stuff to it. Also, in a lot of places we made assumptions
about prelude instead of checking properly.
2025-05-29 16:43:24 +02:00

32 lines
583 B
Python

import pytest
from ..helpers import Suite
@pytest.mark.integration_test
def test_bytes_export_constant():
code_py = """
CONSTANT: bytes = b'Hello'
@exported
def testEntry() -> bytes:
return CONSTANT
"""
result = Suite(code_py).run_code()
assert b"Hello" == result.returned_value[0:5]
assert 5 == len(result.returned_value)
@pytest.mark.integration_test
def test_bytes_export_instantiation():
code_py = """
@exported
def testEntry() -> bytes:
return b'Hello'
"""
result = Suite(code_py).run_code()
assert b"Hello" == result.returned_value