Skip to content

Commit

Permalink
Test array class name
Browse files Browse the repository at this point in the history
  • Loading branch information
Schamper committed Nov 26, 2023
1 parent 91dbe02 commit 6e597da
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,3 +478,20 @@ def test_report_array_size_mismatch(cs: cstruct):

with pytest.raises(ArraySizeError):
a.dumps()


def test_array_class_name(cs: cstruct):
cdef = """
struct test {
uint8 a[2];
};
struct test2 {
uint8 a;
uint8 b[a + 1];
};
"""
cs.load(cdef)

assert cs.test.fields[0].type.__name__ == "uint8[2]"
assert cs.test2.fields[1].type.__name__ == "uint8[a + 1]"

0 comments on commit 6e597da

Please sign in to comment.