Skip to content

Commit ada1791

Browse files
committed
formats_err: add test for leaking enums
Tests for kaitai-io/kaitai_struct#534 Adds new failing test in compliler: [info] - imports_enum_leaking *** FAILED *** [info] [] [info] did not equal [info] [imports/enum_two.ksy: /seq/0/enum: [info] error: unable to find enum 'enum_one::one', searching from enum_two [info] ] (SimpleMatchers.scala:34)
1 parent 1c9f0b3 commit ada1791

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

formats_err/imports/enum_one.ksy

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This is a file that is imported in imports_enum_leaking.ksy
2+
meta:
3+
id: enum_one
4+
seq:
5+
- id: something
6+
type: u1
7+
enum: one
8+
enums:
9+
one:
10+
0: zero

formats_err/imports/enum_two.ksy

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# This is a file that is imported in imports_enum_leaking.ksy
2+
meta:
3+
id: enum_two
4+
# Note: missing import of `enum_one`
5+
seq:
6+
- id: one
7+
type: u1
8+
enum: enum_one::one # Note: `enum_one` is not imported in this spec, so this should cause a compile error
9+
enums:
10+
two:
11+
0: zero

formats_err/imports_enum_leaking.ksy

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# imports/enum_two.ksy: /seq/0/enum:
2+
# error: unable to find enum 'enum_one::one', searching from enum_two
3+
#
4+
meta:
5+
id: imports_enum_leaking
6+
imports:
7+
- imports/enum_one
8+
- imports/enum_two
9+
seq:
10+
- id: another_one
11+
type: u1
12+
enum: enum_one::one
13+
- id: another_two
14+
type: u1
15+
enum: enum_two::two

0 commit comments

Comments
 (0)