-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Partialy implement validation for valid
key
#307
Open
Mingun
wants to merge
2
commits into
kaitai-io:master
Choose a base branch
from
Mingun:valid-validation
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
Fixed (4): ``` [info] - attr_bad_valid_expr *** FAILED *** [info] [] [info] did not equal [info] [attr_bad_valid_expr.ksy: /seq/0/valid/expr: [info] error: invalid type: expected boolean, got Int1Type(true) [info] ] (SimpleMatchers.scala:34) [info] - expr_field_unknown_valid_eq_long *** FAILED *** [info] [] [info] did not equal [info] [expr_field_unknown_valid_eq_long.ksy: /seq/0/valid/eq: [info] error: unable to access 'bar' in expr_field_unknown_valid_eq_long context [info] ] (SimpleMatchers.scala:34) [info] - expr_field_unknown_valid_expr *** FAILED *** [info] [] [info] did not equal [info] [expr_field_unknown_valid_expr.ksy: /seq/0/valid/expr: [info] error: unable to access 'bar' in expr_field_unknown_valid_expr context [info] ] (SimpleMatchers.scala:34) [info] - expr_field_unknown_valid_range *** FAILED *** [info] [] [info] did not equal [info] [expr_field_unknown_valid_range.ksy: /seq/0/valid/min: [info] error: unable to access 'bar' in expr_field_unknown_valid_range context [info] [info] expr_field_unknown_valid_range.ksy: /seq/0/valid/max: [info] error: unable to access 'qux' in expr_field_unknown_valid_range context [info] ] (SimpleMatchers.scala:34) ``` Changed error message (4, must correct model to distinguish between `valid` and `valid.eq`): ``` [info] - attr_bad_valid_eq_long *** FAILED *** [info] [attr_bad_valid_eq_long.ksy: /seq/0/valid/eq: [info] error: invalid type: expected Int1Type(false), got CalcStrType [info] ] [info] did not equal [info] [attr_bad_valid_eq_long.ksy: /seq/0/valid/eq: [info] error: can't compare Int1Type(false) and CalcStrType [info] ] (SimpleMatchers.scala:34) [info] - attr_bad_valid_eq_short *** FAILED *** [info] [attr_bad_valid_eq_short.ksy: /seq/0/valid/eq: [info] error: invalid type: expected Int1Type(false), got CalcStrType [info] ] [info] did not equal [info] [attr_bad_valid_eq_short.ksy: /seq/0/valid: [info] error: can't compare Int1Type(false) and CalcStrType [info] ] (SimpleMatchers.scala:34) [info] - attr_bad_valid_repeat_eq_short *** FAILED *** [info] [attr_bad_valid_repeat_eq_short.ksy: /seq/0/valid/eq: [info] error: invalid type: expected IntMultiType(true,Width4,Some(LittleEndian)), got ArrayTypeInStream(CalcIntType) [info] ] [info] did not equal [info] [attr_bad_valid_repeat_eq_short.ksy: /seq/0/valid: [info] error: can't compare IntMultiType(true,Width4,Some(LittleEndian)) and ArrayTypeInStream(CalcIntType) [info] ] (SimpleMatchers.scala:34) [info] - expr_field_unknown_valid_eq_short *** FAILED *** [info] [expr_field_unknown_valid_eq_short.ksy: /seq/0/valid/eq: [info] error: unable to access 'bar' in expr_field_unknown_valid_eq_short context [info] ] [info] did not equal [info] [expr_field_unknown_valid_eq_short.ksy: /seq/0/valid: [info] error: unable to access 'bar' in expr_field_unknown_valid_eq_short context [info] ] (SimpleMatchers.scala:34) ``` Changed error message (3, expected must be corrected or false-positives): ``` [info] - attr_bad_valid_any_of *** FAILED *** [info] [attr_bad_valid_any_of.ksy: /seq/0/valid/any-of/0: [info] error: invalid type: expected Int1Type(false), got Int1Type(true) [info] [info] attr_bad_valid_any_of.ksy: /seq/0/valid/any-of/1: [info] error: invalid type: expected Int1Type(false), got Int1Type(true) [info] [info] attr_bad_valid_any_of.ksy: /seq/0/valid/any-of/2: [info] error: invalid type: expected Int1Type(false), got CalcBooleanType [info] [info] attr_bad_valid_any_of.ksy: /seq/0/valid/any-of/3: [info] error: invalid type: expected Int1Type(false), got Int1Type(true) [info] ] [info] did not equal [info] [attr_bad_valid_any_of.ksy: /seq/0/valid/any-of/2: [info] error: can't compare Int1Type(false) and CalcBooleanType [info] ] (SimpleMatchers.scala:34) [info] - attr_bad_valid_range *** FAILED *** [info] [attr_bad_valid_range.ksy: /seq/0/valid/min: [info] error: invalid type: expected Int1Type(false), got CalcBooleanType [info] [info] attr_bad_valid_range.ksy: /seq/0/valid/max: [info] error: invalid type: expected Int1Type(false), got CalcStrType [info] ] [info] did not equal [info] [attr_bad_valid_range.ksy: /seq/0/valid/min: [info] error: can't compare Int1Type(false) and CalcBooleanType [info] [info] attr_bad_valid_range.ksy: /seq/0/valid/max: [info] error: can't compare Int1Type(false) and CalcStrType [info] ] (SimpleMatchers.scala:34) [info] - expr_field_unknown_valid_any_of *** FAILED *** [info] [expr_field_unknown_valid_any_of.ksy: /seq/0/valid/any-of/0: [info] error: invalid type: expected Int1Type(false), got Int1Type(true) [info] [info] expr_field_unknown_valid_any_of.ksy: /seq/0/valid/any-of/1: [info] error: unable to access 'bar' in expr_field_unknown_valid_any_of context [info] [info] expr_field_unknown_valid_any_of.ksy: /seq/0/valid/any-of/2: [info] error: invalid type: expected Int1Type(false), got Int1Type(true) [info] [info] expr_field_unknown_valid_any_of.ksy: /seq/0/valid/any-of/3: [info] error: unable to access 'qux' in expr_field_unknown_valid_any_of context [info] ] [info] did not equal [info] [expr_field_unknown_valid_any_of.ksy: /seq/0/valid/any-of/1: [info] error: unable to access 'bar' in expr_field_unknown_valid_any_of context [info] [info] expr_field_unknown_valid_any_of.ksy: /seq/0/valid/any-of/3: [info] error: unable to access 'qux' in expr_field_unknown_valid_any_of context [info] ] (SimpleMatchers.scala:34) ```
Mingun
force-pushed
the
valid-validation
branch
from
September 10, 2024 18:28
fdbbdcf
to
8792049
Compare
…Equals` and make it abstract Fixed (1): [info] - expr_field_unknown_valid_eq_short *** FAILED *** [info] [expr_field_unknown_valid_eq_short.ksy: /seq/0/valid/eq: [info] error: unable to access 'bar' in expr_field_unknown_valid_eq_short context [info] ] [info] did not equal [info] [expr_field_unknown_valid_eq_short.ksy: /seq/0/valid: [info] error: unable to access 'bar' in expr_field_unknown_valid_eq_short context [info] ] (SimpleMatchers.scala:34)
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.
This PR adds missing validation for
valid
keys. Some problems not solved, because I do not know what is the prefered way for you to solve them. Namely:TypeDetector.assertCompareTypes
. Actually the other methods are used which produces another messages. Sometimes this produces false-positives, I guessBelow the changed parts in the output (this is how errors looks after this PR).
Fixed (5):
Changed error message (6, expected must be corrected or false-positives):