Skip to content

Commit

Permalink
add dynarray case to size_in_bytes test
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Apr 21, 2022
1 parent ccf2e0b commit 9c55361
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/functional/context/types/test_size_in_bytes.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ def test_array_value_types(build_node, type_str, location, length, size):
assert type_definition.size_in_bytes == size


@pytest.mark.parametrize("type_str", BASE_TYPES)
@pytest.mark.parametrize("location", LOCATIONS)
@pytest.mark.parametrize("length", range(1, 4))
def test_dynamic_array_lengths(build_node, type_str, location, length):
node = build_node(f"DynArray[{type_str}, {length}]")
type_definition = get_type_from_annotation(node, location)

assert type_definition.size_in_bytes == 32 + length * 32


@pytest.mark.parametrize("type_str", BASE_TYPES)
@pytest.mark.parametrize("location", LOCATIONS)
@pytest.mark.parametrize("length", range(1, 4))
Expand Down

0 comments on commit 9c55361

Please sign in to comment.