Adapt and extend the test suite to cover the new enums syntax#140
Draft
generalmimon wants to merge 9 commits intomasterfrom
Draft
Adapt and extend the test suite to cover the new enums syntax#140generalmimon wants to merge 9 commits intomasterfrom
enums syntax#140generalmimon wants to merge 9 commits intomasterfrom
Conversation
enums syntaxenums syntax
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.
Also update the expected error message based on the changes in kaitai-io/kaitai_struct_compiler@23bfab8
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.
e8460d0 to
46ad642
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See kaitai-io/kaitai_struct#1288
This accompanies the changes in kaitai-io/kaitai_struct_compiler#335.