From c7e4284cd41bf80e7e2383fc4c58352a575189d9 Mon Sep 17 00:00:00 2001 From: Peter Cornell Date: Thu, 21 May 2020 14:14:24 -0700 Subject: [PATCH] test(import): multiple imports from the same schema id --- schema/import/import_types.isl | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 schema/import/import_types.isl diff --git a/schema/import/import_types.isl b/schema/import/import_types.isl new file mode 100644 index 0000000..4c0b881 --- /dev/null +++ b/schema/import/import_types.isl @@ -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 }, +] +