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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
suites:
-
name: Attributes
suites:
-
name: missing
resources:
-
source: |-
foo = Foo
bar = Bar
.attr = Bar Attribute
baz = { foo } Baz
qux = { foo } Qux
.attr = Qux Attribute
ref-foo = { foo.missing }
ref-bar = { bar.missing }
ref-baz = { baz.missing }
ref-qux = { qux.missing }
tests:
-
name: falls back to id.attr for entities with string values and no attributes
asserts:
-
id: ref-foo
value: "{foo.missing}"
errors:
-
type: Reference
desc: "Unknown attribute: foo.missing"
-
name: falls back to id.attr for entities with string values and other attributes
asserts:
-
id: ref-bar
value: "{bar.missing}"
errors:
-
type: Reference
desc: "Unknown attribute: bar.missing"
-
name: falls back to id.attr for entities with pattern values and no attributes
asserts:
-
id: ref-baz
value: "{baz.missing}"
errors:
-
type: Reference
desc: "Unknown attribute: baz.missing"
-
name: falls back to id.attr for entities with pattern values and other attributes
asserts:
-
id: ref-qux
value: "{qux.missing}"
errors:
-
type: Reference
desc: "Unknown attribute: qux.missing"
-
name: with string values
resources:
-
source: |-
foo = Foo
.attr = Foo Attribute
bar = { foo } Bar
.attr = Bar Attribute
ref-foo = { foo.attr }
ref-bar = { bar.attr }
tests:
-
name: can be referenced for entities with string values
asserts:
-
id: ref-foo
value: Foo Attribute
-
name: can be formatted directly for entities with string values
asserts:
-
id: foo
attribute: attr
value: Foo Attribute
-
name: can be referenced for entities with pattern values
asserts:
-
id: ref-bar
value: Bar Attribute
-
name: can be formatted directly for entities with pattern values
asserts:
-
id: bar
attribute: attr
value: Bar Attribute
-
name: with simple pattern values
resources:
-
source: |-
foo = Foo
bar = Bar
.attr = { foo } Attribute
baz = { foo } Baz
.attr = { foo } Attribute
qux = Qux
.attr = { qux } Attribute
ref-bar = { bar.attr }
ref-baz = { baz.attr }
ref-qux = { qux.attr }
tests:
-
name: can be referenced for entities with string values
asserts:
-
id: ref-bar
value: Foo Attribute
-
name: can be formatted directly for entities with string values
asserts:
-
id: bar
attribute: attr
value: Foo Attribute
-
name: can be referenced for entities with simple pattern values
asserts:
-
id: ref-baz
value: Foo Attribute
-
name: can be formatted directly for entities with simple pattern values
asserts:
-
id: baz
attribute: attr
value: Foo Attribute
-
name: works with self-references
asserts:
-
id: ref-qux
value: Qux Attribute
-
name: can be formatted directly when it uses a self-reference
asserts:
-
id: qux
attribute: attr
value: Qux Attribute
-
name: with values with select expressions
resources:
-
source: |-
foo = Foo
.attr = { "a" ->
[a] A
*[b] B
}
ref-foo = { foo.attr }
tests:
-
name: can be referenced
asserts:
-
id: ref-foo
value: A
-
name: can be formatted directly
asserts:
-
id: foo
attribute: attr
value: A