@curly-message/conformance 1.0.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +266 -0
- package/bin/conformance.js +37 -0
- package/bin/manifest.js +24 -0
- package/dist/index.d.ts +225 -0
- package/dist/index.js +4 -0
- package/fixtures/comparisons.json +916 -0
- package/fixtures/conversion.json +231 -0
- package/fixtures/escaping-extensions.json +84 -0
- package/fixtures/escaping.json +546 -0
- package/fixtures/extensions.json +826 -0
- package/fixtures/fallback-intl.json +51 -0
- package/fixtures/fallback.json +774 -0
- package/fixtures/grammar.json +875 -0
- package/fixtures/intl.json +3057 -0
- package/fixtures/limits.json +63 -0
- package/fixtures/nesting.json +251 -0
- package/fixtures/reports.json +512 -0
- package/fixtures/resolution.json +742 -0
- package/fixtures/security-extensions.json +52 -0
- package/fixtures/security.json +246 -0
- package/fixtures/whitespace.json +1000 -0
- package/index.json +102 -0
- package/package.json +76 -0
- package/schema/fixture.schema.json +264 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": "curly-message-1",
|
|
3
|
+
"level": "core",
|
|
4
|
+
"section": "13",
|
|
5
|
+
"cases": [
|
|
6
|
+
{
|
|
7
|
+
"id": "limits/passes-at-limit",
|
|
8
|
+
"description": "At least the declared number of passes is performed: a chain that settles in exactly that many passes settles, with nothing to report.",
|
|
9
|
+
"section": "13",
|
|
10
|
+
"generate": "passes-at-limit"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"id": "limits/passes-over-limit",
|
|
14
|
+
"description": "On reaching the pass limit the last settled text is returned with its placeholder unresolved, nothing raises, and pass-limit is reported once with origin limit.",
|
|
15
|
+
"section": "13",
|
|
16
|
+
"generate": "passes-over-limit"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"id": "limits/output-at-limit",
|
|
20
|
+
"description": "At least the declared number of characters of output is permitted: an output of exactly that length is produced whole, with nothing to report.",
|
|
21
|
+
"section": "13",
|
|
22
|
+
"generate": "output-at-limit"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"id": "limits/output-over-limit",
|
|
26
|
+
"description": "A pass whose output would exceed the limit is discarded whole, so the message as it reached the first pass is what settles, and output-limit is reported once with origin limit.",
|
|
27
|
+
"section": "13",
|
|
28
|
+
"generate": "output-over-limit"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"id": "limits/output-over-limit-stops",
|
|
32
|
+
"description": "A placeholder past the output limit is neither resolved nor reported, and the host-defined modifier it names is not called.",
|
|
33
|
+
"section": "13",
|
|
34
|
+
"generate": "output-over-limit-stops"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"id": "limits/conversion-over-limit",
|
|
38
|
+
"description": "A serialization that reaches the conversion limit is a conversion that cannot describe the value: the placeholder takes the chain and unserializable-value is reported with origin payload.",
|
|
39
|
+
"section": "13",
|
|
40
|
+
"generate": "conversion-over-limit"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"id": "limits/pass-limit-unescapes-settled-text",
|
|
44
|
+
"description": "A limit ends the process the way a settling pass does, so the single removal of escape sequences still runs over the text the pass limit stopped, which a self-referential value reaches whatever the limit is.",
|
|
45
|
+
"section": "13",
|
|
46
|
+
"message": "a\\;b {{v}}",
|
|
47
|
+
"payload": {
|
|
48
|
+
"v": "{{v}}"
|
|
49
|
+
},
|
|
50
|
+
"key": "limits.self-reference",
|
|
51
|
+
"expected": {
|
|
52
|
+
"output": "a;b {{v}}",
|
|
53
|
+
"reports": [
|
|
54
|
+
{
|
|
55
|
+
"code": "pass-limit",
|
|
56
|
+
"origin": "limit",
|
|
57
|
+
"key": "limits.self-reference"
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
}
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": "curly-message-1",
|
|
3
|
+
"level": "core",
|
|
4
|
+
"section": "12",
|
|
5
|
+
"cases": [
|
|
6
|
+
{
|
|
7
|
+
"id": "nesting/pass-output-feeds-next",
|
|
8
|
+
"description": "The output of a pass is the input of the next, so a value naming a value naming a value settles over repeated passes.",
|
|
9
|
+
"section": "5",
|
|
10
|
+
"message": "{{v1}}",
|
|
11
|
+
"payload": {
|
|
12
|
+
"v1": "{{v2}}",
|
|
13
|
+
"v2": "{{v3}}",
|
|
14
|
+
"v3": "X"
|
|
15
|
+
},
|
|
16
|
+
"expected": {
|
|
17
|
+
"output": "X"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"id": "nesting/every-placeholder-each-pass",
|
|
22
|
+
"description": "Each pass replaces every placeholder in the current text, those an earlier pass introduced included.",
|
|
23
|
+
"section": "5",
|
|
24
|
+
"message": "{{a}}|{{b}}",
|
|
25
|
+
"payload": {
|
|
26
|
+
"a": "{{b}}",
|
|
27
|
+
"b": "B"
|
|
28
|
+
},
|
|
29
|
+
"expected": {
|
|
30
|
+
"output": "B|B"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"id": "nesting/message-converted-before-first-pass",
|
|
35
|
+
"description": "A message a host wrote as a plain object reaches the first pass as its serialization, and is interpolated like any other.",
|
|
36
|
+
"section": "5",
|
|
37
|
+
"message": {
|
|
38
|
+
"a": "{{value}}"
|
|
39
|
+
},
|
|
40
|
+
"payload": {
|
|
41
|
+
"value": "TEST_STRING"
|
|
42
|
+
},
|
|
43
|
+
"expected": {
|
|
44
|
+
"output": "{\"a\":\"TEST_STRING\"}"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"id": "nesting/message-conversion-unescaped",
|
|
49
|
+
"description": "A message a host wrote as an array is unescaped like any other, so the backslash its serialization doubled is single in the output.",
|
|
50
|
+
"section": "5",
|
|
51
|
+
"message": [
|
|
52
|
+
"a\\;b"
|
|
53
|
+
],
|
|
54
|
+
"payload": {},
|
|
55
|
+
"expected": {
|
|
56
|
+
"output": "[\"a\\;b\"]"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"id": "nesting/value-escape-not-a-placeholder",
|
|
61
|
+
"description": "An escape sequence a value introduces is still an escape sequence on the next pass, so an escaped pair never becomes a placeholder and is removed at the end.",
|
|
62
|
+
"section": "5",
|
|
63
|
+
"message": "{{v}}",
|
|
64
|
+
"payload": {
|
|
65
|
+
"v": "a\\;b \\{\\{n\\}\\}",
|
|
66
|
+
"n": "N"
|
|
67
|
+
},
|
|
68
|
+
"expected": {
|
|
69
|
+
"output": "a;b {{n}}"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"id": "nesting/escapes-removed-once",
|
|
74
|
+
"description": "Escape sequences are removed exactly once, so a doubly escaped pair in a value leaves a singly escaped pair, not a placeholder.",
|
|
75
|
+
"section": "5",
|
|
76
|
+
"message": "{{v}}",
|
|
77
|
+
"payload": {
|
|
78
|
+
"v": "\\\\{\\\\{n\\\\}\\\\}",
|
|
79
|
+
"n": "N"
|
|
80
|
+
},
|
|
81
|
+
"expected": {
|
|
82
|
+
"output": "\\{\\{n\\}\\}"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"id": "nesting/message-escape-survives-passes",
|
|
87
|
+
"description": "Escape sequences are removed after the last pass, so an escaped pair in the message is still an escape while later passes run.",
|
|
88
|
+
"section": "5",
|
|
89
|
+
"message": "\\{\\{a\\}\\} {{v}}",
|
|
90
|
+
"payload": {
|
|
91
|
+
"v": "{{a}}",
|
|
92
|
+
"a": "A"
|
|
93
|
+
},
|
|
94
|
+
"expected": {
|
|
95
|
+
"output": "{{a}} A"
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"id": "nesting/missing-message-default-unescaped",
|
|
100
|
+
"description": "The payload default a missing message takes is text the passes resolve, so its escape sequences are removed at the end.",
|
|
101
|
+
"section": "5",
|
|
102
|
+
"message": {
|
|
103
|
+
"$curly": "undefined"
|
|
104
|
+
},
|
|
105
|
+
"payload": {
|
|
106
|
+
"default": "a\\;b"
|
|
107
|
+
},
|
|
108
|
+
"key": "greeting",
|
|
109
|
+
"expected": {
|
|
110
|
+
"output": "a;b"
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"id": "nesting/value-carries-placeholder",
|
|
115
|
+
"description": "A value may resolve to text containing a placeholder, which the following pass resolves.",
|
|
116
|
+
"section": "12",
|
|
117
|
+
"message": "{{v}}",
|
|
118
|
+
"payload": {
|
|
119
|
+
"v": "TEST_{{another}}",
|
|
120
|
+
"another": "VALUE"
|
|
121
|
+
},
|
|
122
|
+
"expected": {
|
|
123
|
+
"output": "TEST_VALUE"
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"id": "nesting/option-value-text-joins-next-pass",
|
|
128
|
+
"description": "The text an option value resolves to is read by the following pass with what surrounds it, so a brace it contributes completes a placeholder there.",
|
|
129
|
+
"section": "12",
|
|
130
|
+
"message": "{{v; a:{; default:D}}{n}}",
|
|
131
|
+
"payload": {
|
|
132
|
+
"v": "a",
|
|
133
|
+
"n": "N"
|
|
134
|
+
},
|
|
135
|
+
"expected": {
|
|
136
|
+
"output": "N"
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"id": "nesting/inline-default-text-joins-next-pass",
|
|
141
|
+
"description": "The text an inline default resolves to is read by the following pass with what surrounds it, so a brace it contributes completes a placeholder there.",
|
|
142
|
+
"section": "12",
|
|
143
|
+
"message": "{{v; default:{}}{n}}",
|
|
144
|
+
"payload": {
|
|
145
|
+
"n": "N"
|
|
146
|
+
},
|
|
147
|
+
"expected": {
|
|
148
|
+
"output": "N"
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"id": "nesting/payload-default-carries-placeholder",
|
|
153
|
+
"description": "A payload default may resolve to text containing a placeholder, which the following pass resolves.",
|
|
154
|
+
"section": "12",
|
|
155
|
+
"message": "{{v}}",
|
|
156
|
+
"payload": {
|
|
157
|
+
"default": "P-{{n}}",
|
|
158
|
+
"n": "N"
|
|
159
|
+
},
|
|
160
|
+
"expected": {
|
|
161
|
+
"output": "P-N"
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"id": "nesting/wrapper-default-carries-placeholder",
|
|
166
|
+
"description": "A wrapper default may resolve to text containing a placeholder, which the following pass resolves.",
|
|
167
|
+
"section": "12",
|
|
168
|
+
"message": "{{v}}",
|
|
169
|
+
"payload": {
|
|
170
|
+
"v": {
|
|
171
|
+
"default": "W-{{n}}"
|
|
172
|
+
},
|
|
173
|
+
"n": "N"
|
|
174
|
+
},
|
|
175
|
+
"expected": {
|
|
176
|
+
"output": "W-N"
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"id": "nesting/wrapper-default-through-selection",
|
|
181
|
+
"description": "A wrapper default a selection falls back to is text the following pass resolves, placeholders included.",
|
|
182
|
+
"section": "12",
|
|
183
|
+
"message": "{{v:eq; z:Z}}",
|
|
184
|
+
"payload": {
|
|
185
|
+
"v": {
|
|
186
|
+
"value": "q",
|
|
187
|
+
"default": "W-{{n}}"
|
|
188
|
+
},
|
|
189
|
+
"n": "N"
|
|
190
|
+
},
|
|
191
|
+
"expected": {
|
|
192
|
+
"output": "W-N"
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"id": "nesting/missing-message-default-carries-placeholder",
|
|
197
|
+
"description": "The payload default a missing message takes is among what may resolve to text containing placeholders, unlike the key echo.",
|
|
198
|
+
"section": "12",
|
|
199
|
+
"message": {
|
|
200
|
+
"$curly": "undefined"
|
|
201
|
+
},
|
|
202
|
+
"payload": {
|
|
203
|
+
"default": "P-{{n}}",
|
|
204
|
+
"n": "N"
|
|
205
|
+
},
|
|
206
|
+
"key": "greeting",
|
|
207
|
+
"expected": {
|
|
208
|
+
"output": "P-N"
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"id": "nesting/enclosing-scanned-again",
|
|
213
|
+
"description": "A construct enclosing another is not a placeholder: the inner one resolves first, and the enclosing one is scanned again over what it resolved to.",
|
|
214
|
+
"section": "12",
|
|
215
|
+
"message": "{{v; a:{{n}}; default:D}}",
|
|
216
|
+
"payload": {
|
|
217
|
+
"v": "a",
|
|
218
|
+
"n": "N"
|
|
219
|
+
},
|
|
220
|
+
"expected": {
|
|
221
|
+
"output": "N"
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"id": "nesting/enclosing-closes-early",
|
|
226
|
+
"description": "A value carrying a closing pair closes the enclosing construct early on the following pass, and the rest is literal text.",
|
|
227
|
+
"section": "12",
|
|
228
|
+
"message": "{{v; a:{{n}}; default:D}}",
|
|
229
|
+
"payload": {
|
|
230
|
+
"v": "a",
|
|
231
|
+
"n": "X}}"
|
|
232
|
+
},
|
|
233
|
+
"expected": {
|
|
234
|
+
"output": "X; default:D}}"
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"id": "nesting/enclosing-never-derives",
|
|
239
|
+
"description": "A value carrying an opening pair keeps the enclosing construct from deriving when it is scanned again, and both pairs stand as literal text.",
|
|
240
|
+
"section": "12",
|
|
241
|
+
"message": "{{v; a:{{n}}",
|
|
242
|
+
"payload": {
|
|
243
|
+
"v": "a",
|
|
244
|
+
"n": "{{"
|
|
245
|
+
},
|
|
246
|
+
"expected": {
|
|
247
|
+
"output": "{{v; a:{{"
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
]
|
|
251
|
+
}
|