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
suites:
-
name: Variables
suites:
-
name: in values
resources:
-
source: |-
foo = Foo { $num }
bar = { foo }
baz =
.attr = Baz Attribute { $num }
qux = { "a" ->
*[a] Baz Variant A { $num }
}
tests:
-
name: can be used in the message value
asserts:
-
id: foo
args:
num: 3
value: Foo 3
-
name: can be used in the message value which is referenced
asserts:
-
id: bar
args:
num: 3
value: Foo 3
-
name: can be used in an attribute
asserts:
-
id: baz
attribute: attr
args:
num: 3
value: Baz Attribute 3
-
name: can be used in a variant
asserts:
-
id: qux
args:
num: 3
value: Baz Variant A 3
-
name: in selectors
resources:
-
source: |-
foo = { $num ->
*[3] Foo
}
tests:
-
name: can be used as a selector
asserts:
-
id: foo
args:
num: 3
value: Foo
-
name: in function calls
resources:
-
source: |-
foo = { NUMBER($num) }
bundles:
-
functions:
- NUMBER
tests:
-
name: can be a positional argument
asserts:
-
id: foo
args:
num: 3
value: 3
-
name: simple errors
resources:
-
source: |-
foo = { $arg }
tests:
-
name: falls back to argument's name if it's missing
asserts:
-
id: foo
value: "{$arg}"
errors:
-
type: Reference
desc: "Unknown variable: $arg"
-
name: and strings
resources:
-
source: |-
foo = { $arg }
tests:
-
name: can be a string
asserts:
-
id: foo
args:
arg: Argument
value: Argument
-
name: and numbers
resources:
-
source: |-
foo = { $arg }
tests:
-
name: can be a number
asserts:
-
id: foo
args:
arg: 1
value: 1