Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Partially implement validation for
valid
key
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) ```
- Loading branch information