phasm/tests/integration/test_runtime_checks.py
Johan B.W. de Vries 374231d206 bytes, u8 types
2022-06-25 20:45:33 +02:00

16 lines
306 B
Python

import pytest
from .helpers import Suite
@pytest.mark.integration_test
def test_bytes_index_out_of_bounds():
code_py = """
@exported
def testEntry(f: bytes) -> u8:
return f[50]
"""
result = Suite(code_py, 'test_call').run_code(b'Short', b'Long' * 100)
assert 0 == result.returned_value