-
Notifications
You must be signed in to change notification settings - Fork 8
/
ion_schema_tests.isl
59 lines (56 loc) · 1.44 KB
/
ion_schema_tests.isl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
$ion_schema_1_0
type::{
name: ion_schema_test_case,
annotations: closed::required::[$test],
one_of: [
{
container_length: range::[2, 3],
fields: {
type: { type: symbol, occurs: required },
should_accept_as_valid: list,
should_reject_as_invalid: list,
},
content: closed,
},
{
fields: {
description: { type: string, occurs: required },
invalid_schemas: { type: list, occurs: required, element: sexp },
isl_for_isl_can_validate: bool,
},
content: closed,
},
{
fields: {
description: { type: string, occurs: required },
valid_schemas: { type: list, occurs: required, element: sexp },
},
content: closed,
},
{
fields: {
description: { type: string, occurs: required },
invalid_types: { type: list, occurs: required },
isl_for_isl_can_validate: bool,
},
content: closed,
},
]
}
type::{
// Valid test case or not a test at all
name: maybe_test_case,
type: $any,
one_of: [
// All elements must be a valid test case
ion_schema_test_case,
// Or they must not have the `$test` annotation
{ type: $any, not: { annotations: required::[$test] } },
]
}
type::{
name: ion_schema_test_file,
// Following line is commented out because ion-schema-rust doesn't recognized document, as of [email protected]
// type: document,
element: maybe_test_case,
}