Skip to content

Adapt and extend the test suite to cover the new enums syntax#140

Draft
generalmimon wants to merge 9 commits intomasterfrom
new-enums-syntax
Draft

Adapt and extend the test suite to cover the new enums syntax#140
generalmimon wants to merge 9 commits intomasterfrom
new-enums-syntax

Conversation

@generalmimon
Copy link
Copy Markdown
Member

@generalmimon generalmimon changed the title Update test formats to use the new enums syntax Adapt and extend the test suite to cover the new enums syntax Apr 18, 2026
See kaitai-io/kaitai_struct#1288

This commit fixes only the tests that were broken compared to the
`master` branch when running `sbt test` in a compiler that requires the
new syntax for enum definitions:
kaitai-io/kaitai_struct_compiler#335
See kaitai-io/kaitai_struct#1288

It doesn't seem to be strictly necessary to upgrade enum definitions to
the new syntax, because in the current KSC implementation, the expected
fatal error occurs before the `enums` map is checked (and possibly
rejected). However, this behavior is implementation-specific, so in
order to make the tests as implementation-independent as possible, it's
best to avoid any unintended errors besides the expected (intended) one.
Like `formats_err/enum_underlying_type_mismatch_s4_into_u4.ksy`, but as
the name suggests, it tries to fit `s1` into `b7`. This is an effort to
achieve slightly better coverage for changes in
kaitai-io/kaitai_struct_compiler@23bfab8

I find the `s1 -> b7` case interesting because `b7` is a subset of `s1`
(so the other way around than required), and also because the maximum
value of both `s1` and `b7` is 127.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant