-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
formats_err: add test for leaking enums
Tests for kaitai-io/kaitai_struct#534 Adds new failing test in compiler: [info] - imports_enum_leaking *** FAILED *** [info] [] [info] did not equal [info] [imports/enum_two.ksy: /seq/0/enum: [info] error: unable to find type 'enum_one, searching from 'enum_two' [info] ] (SimpleMatchers.scala:34)
- Loading branch information
Showing
3 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# This is a file that is imported in imports_enum_leaking.ksy | ||
meta: | ||
id: enum_one | ||
seq: | ||
- id: something | ||
type: u1 | ||
enum: one | ||
enums: | ||
one: | ||
0: zero |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# This is a file that is imported in imports_enum_leaking.ksy | ||
meta: | ||
id: enum_two | ||
# Note: missing import of `enum_one` | ||
seq: | ||
- id: one | ||
type: u1 | ||
enum: enum_one::one # Note: `enum_one` is not imported in this spec, so this should cause a compile error | ||
instances: | ||
# Enum resolution in value instances significantly different from enum resolution in other attributes | ||
instance_one: | ||
value: 0 | ||
enum: enum_one::one # Note: `enum_one` is not imported in this spec, so this should cause a compile error | ||
enums: | ||
two: | ||
0: zero |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# imports/enum_two.ksy: /seq/0/enum: | ||
# error: unable to find type 'enum_one', searching from 'enum_two' | ||
# | ||
# imports/enum_two.ksy: /instances/instance_one/enum: | ||
# error: unable to find type 'enum_one', searching from 'enum_two' | ||
# | ||
meta: | ||
id: imports_enum_leaking | ||
imports: | ||
- imports/enum_one | ||
- imports/enum_two | ||
seq: | ||
- id: another_one | ||
type: u1 | ||
enum: enum_one::one | ||
- id: another_two | ||
type: u1 | ||
enum: enum_two::two | ||
instances: | ||
instance_one: | ||
value: 0 | ||
enum: enum_one::one | ||
instance_two: | ||
value: 0 | ||
enum: enum_two::two |