Skip to content

Commit 6e597da

Browse files
committed
Test array class name
1 parent 91dbe02 commit 6e597da

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/test_basic.py

+17
Original file line numberDiff line numberDiff line change
@@ -478,3 +478,20 @@ def test_report_array_size_mismatch(cs: cstruct):
478478

479479
with pytest.raises(ArraySizeError):
480480
a.dumps()
481+
482+
483+
def test_array_class_name(cs: cstruct):
484+
cdef = """
485+
struct test {
486+
uint8 a[2];
487+
};
488+
489+
struct test2 {
490+
uint8 a;
491+
uint8 b[a + 1];
492+
};
493+
"""
494+
cs.load(cdef)
495+
496+
assert cs.test.fields[0].type.__name__ == "uint8[2]"
497+
assert cs.test2.fields[1].type.__name__ == "uint8[a + 1]"

0 commit comments

Comments
 (0)