You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ensure that contents and valid apply to individual elements
Resolveskaitai-io/kaitai_struct#1117
This is how the `contents` key worked until KS 0.8, but then in KS 0.9,
`contents` started to be converted to the newly introduced `valid`,
which was applied only once at the end on the final value. This means
that it was applied on the entire array in the case of repeated fields.
However, the behavior of `valid` + `repeat` wasn't tested anywhere, so I
think it was an oversight. Note that the Kaitai Struct language doesn't
define an equality `==` operation for true arrays, so it wouldn't even
work. Running the `valid` and `contents` checks on each element is more
flexible (and also seems more useful).
Fixes the following tests for all languages except Go (will be fixed in
the following commit), Nim, Perl and Construct:
* ValidFailRepeatAnyofInt
* ValidFailRepeatContents
* ValidFailRepeatEqInt
* ValidFailRepeatExpr
* ValidFailRepeatInst
* ValidFailRepeatMaxInt
* ValidFailRepeatMinInt
These tests were added in
kaitai-io/kaitai_struct_tests@98a68fc
0 commit comments