Skip to content

Commit

Permalink
test(import): multiple imports from the same schema id (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Cornell authored May 27, 2020
1 parent 44fb7d4 commit 117d982
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions schema/import/import_types.isl
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
schema_header::{
imports: [
{ id: "schema/import/abcde.isl", type: a, as: a2 },
{ id: "schema/util/positive_int.isl" },
{ id: "schema/import/abcde.isl", type: b },
{ id: "schema/util/positive_int.isl", type: positive_int, as: posint },
{ id: "schema/import/abcde.isl", type: c, as: c2 },
],
}
type::{
name: import_types_test,
type: struct,
fields: {
a2: a2,
positive_int: positive_int,
b: b,
posint: posint,
c2: c2,
},
}
schema_footer::{
}

valid::[
{ a: a, positive_int: 5, b: b, posint: 6, c: c },
]

invalid::[
{ a: b, positive_int: 5, b: b, posint: 6, c: c },
{ a: a, positive_int: -1, b: b, posint: 6, c: c },
{ a: a, positive_int: 5, b: a, posint: 6, c: c },
{ a: a, positive_int: 5, b: b, posint: -1, c: c },
{ a: a, positive_int: 5, b: b, posint: 6, c: b },
]

0 comments on commit 117d982

Please sign in to comment.