@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,546 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": "curly-message-1",
|
|
3
|
+
"level": "core",
|
|
4
|
+
"section": "7",
|
|
5
|
+
"cases": [
|
|
6
|
+
{
|
|
7
|
+
"id": "escaping/colon",
|
|
8
|
+
"description": "A backslash before a colon writes the colon as text.",
|
|
9
|
+
"section": "7",
|
|
10
|
+
"message": "a\\:b",
|
|
11
|
+
"expected": {
|
|
12
|
+
"output": "a:b"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"id": "escaping/semicolon",
|
|
17
|
+
"description": "A backslash before a semicolon writes the semicolon as text.",
|
|
18
|
+
"section": "7",
|
|
19
|
+
"message": "a\\;b",
|
|
20
|
+
"expected": {
|
|
21
|
+
"output": "a;b"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"id": "escaping/opening-brace",
|
|
26
|
+
"description": "A backslash before an opening brace writes the brace as text.",
|
|
27
|
+
"section": "7",
|
|
28
|
+
"message": "a\\{b",
|
|
29
|
+
"expected": {
|
|
30
|
+
"output": "a{b"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"id": "escaping/closing-brace",
|
|
35
|
+
"description": "A backslash before a closing brace writes the brace as text.",
|
|
36
|
+
"section": "7",
|
|
37
|
+
"message": "a\\}b",
|
|
38
|
+
"expected": {
|
|
39
|
+
"output": "a}b"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"id": "escaping/backslash",
|
|
44
|
+
"description": "Two backslashes write a single backslash.",
|
|
45
|
+
"section": "7",
|
|
46
|
+
"message": "a\\\\b",
|
|
47
|
+
"expected": {
|
|
48
|
+
"output": "a\\b"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"id": "escaping/literal-placeholder",
|
|
53
|
+
"description": "A delimiter written as text escapes both of its braces, and the construct resolves nothing even where the payload has the key.",
|
|
54
|
+
"section": "7",
|
|
55
|
+
"message": "\\{\\{v\\}\\}",
|
|
56
|
+
"payload": {
|
|
57
|
+
"v": "HIT"
|
|
58
|
+
},
|
|
59
|
+
"expected": {
|
|
60
|
+
"output": "{{v}}"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"id": "escaping/every-whitespace-member",
|
|
65
|
+
"description": "Every member of the whitespace class escapes, the line terminators among them: the backslash before each of the twenty-five is removed.",
|
|
66
|
+
"section": "7",
|
|
67
|
+
"message": "\\\u0009|\\\u000a|\\\u000b|\\\u000c|\\\u000d|\\ |\\\u00a0|\\\u1680|\\\u2000|\\\u2001|\\\u2002|\\\u2003|\\\u2004|\\\u2005|\\\u2006|\\\u2007|\\\u2008|\\\u2009|\\\u200a|\\\u2028|\\\u2029|\\\u202f|\\\u205f|\\\u3000|\\\ufeff",
|
|
68
|
+
"expected": {
|
|
69
|
+
"output": "\u0009|\u000a|\u000b|\u000c|\u000d| |\u00a0|\u1680|\u2000|\u2001|\u2002|\u2003|\u2004|\u2005|\u2006|\u2007|\u2008|\u2009|\u200a|\u2028|\u2029|\u202f|\u205f|\u3000|\ufeff"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"id": "escaping/backslash-before-structural",
|
|
74
|
+
"description": "A literal backslash in front of a structural character is written by escaping both.",
|
|
75
|
+
"section": "7",
|
|
76
|
+
"message": "\\\\\\:",
|
|
77
|
+
"expected": {
|
|
78
|
+
"output": "\\:"
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"id": "escaping/backslash-before-other",
|
|
83
|
+
"description": "A backslash before a character that carries no structural meaning denotes itself, so both characters stand.",
|
|
84
|
+
"section": "7",
|
|
85
|
+
"message": "\\a",
|
|
86
|
+
"expected": {
|
|
87
|
+
"output": "\\a"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"id": "escaping/backslash-before-letters",
|
|
92
|
+
"description": "A text whose backslashes all precede letters renders unchanged.",
|
|
93
|
+
"section": "7",
|
|
94
|
+
"message": "C:\\Users\\name",
|
|
95
|
+
"expected": {
|
|
96
|
+
"output": "C:\\Users\\name"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"id": "escaping/backslash-at-end",
|
|
101
|
+
"description": "A backslash at the end of the message has no character to cancel and denotes itself.",
|
|
102
|
+
"section": "7",
|
|
103
|
+
"message": "abc\\",
|
|
104
|
+
"expected": {
|
|
105
|
+
"output": "abc\\"
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"id": "escaping/backslash-at-end-of-value",
|
|
110
|
+
"description": "A backslash a value carries at the very end of the final text has nothing to cancel and stays.",
|
|
111
|
+
"section": "7",
|
|
112
|
+
"message": "{{v}}",
|
|
113
|
+
"payload": {
|
|
114
|
+
"v": "abc\\"
|
|
115
|
+
},
|
|
116
|
+
"expected": {
|
|
117
|
+
"output": "abc\\"
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"id": "escaping/value-backslash-joins-text",
|
|
122
|
+
"description": "A backslash a value ends in consumes the message character after it, because the removal runs over the final text.",
|
|
123
|
+
"section": "7",
|
|
124
|
+
"message": "{{v}};",
|
|
125
|
+
"payload": {
|
|
126
|
+
"v": "x\\"
|
|
127
|
+
},
|
|
128
|
+
"expected": {
|
|
129
|
+
"output": "x;"
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"id": "escaping/key-colon-and-semicolon",
|
|
134
|
+
"description": "A key carries a colon and a semicolon as escape sequences and is matched after unescaping.",
|
|
135
|
+
"section": "7",
|
|
136
|
+
"message": "{{pl\\:ace\\;holder}}",
|
|
137
|
+
"payload": {
|
|
138
|
+
"pl:ace;holder": "TEST \\{\\{VALUE\\}\\}"
|
|
139
|
+
},
|
|
140
|
+
"expected": {
|
|
141
|
+
"output": "TEST {{VALUE}}"
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"id": "escaping/key-leading-semicolon",
|
|
146
|
+
"description": "An escape sequence at the very start of a key is part of the key.",
|
|
147
|
+
"section": "7",
|
|
148
|
+
"message": "{{\\;value}}",
|
|
149
|
+
"payload": {
|
|
150
|
+
";value": "HIT"
|
|
151
|
+
},
|
|
152
|
+
"expected": {
|
|
153
|
+
"output": "HIT"
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"id": "escaping/key-brace-inside",
|
|
158
|
+
"description": "An escaped closing brace inside a key is a member of the escapable set wherever it stands, so the backslash is removed and the key holds the brace.",
|
|
159
|
+
"section": "7",
|
|
160
|
+
"message": "{{a\\}b}}",
|
|
161
|
+
"payload": {
|
|
162
|
+
"a}b": "HIT"
|
|
163
|
+
},
|
|
164
|
+
"expected": {
|
|
165
|
+
"output": "HIT"
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"id": "escaping/key-escaped-space",
|
|
170
|
+
"description": "A space an escape sequence claims belongs to the key and is not trimmed from it.",
|
|
171
|
+
"section": "8",
|
|
172
|
+
"message": "[{{\\ v\\ }}]",
|
|
173
|
+
"payload": {
|
|
174
|
+
" v ": "HIT",
|
|
175
|
+
"v": "TRIMMED"
|
|
176
|
+
},
|
|
177
|
+
"expected": {
|
|
178
|
+
"output": "[HIT]"
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"id": "escaping/key-backslash-before-other",
|
|
183
|
+
"description": "A backslash before a non-structural character in a key stands with it, so the key carries both.",
|
|
184
|
+
"section": "7",
|
|
185
|
+
"message": "{{a\\xb}}",
|
|
186
|
+
"payload": {
|
|
187
|
+
"a\\xb": "HIT",
|
|
188
|
+
"axb": "STRIPPED"
|
|
189
|
+
},
|
|
190
|
+
"expected": {
|
|
191
|
+
"output": "HIT"
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"id": "escaping/key-line-terminator",
|
|
196
|
+
"description": "A line terminator is escapable, but an escape sequence carrying one is never inside a placeholder, so the construct is literal text.",
|
|
197
|
+
"section": "7",
|
|
198
|
+
"message": "{{v\\\u000a}}",
|
|
199
|
+
"payload": {
|
|
200
|
+
"v": "HIT",
|
|
201
|
+
"v\u000a": "TERMINATOR"
|
|
202
|
+
},
|
|
203
|
+
"expected": {
|
|
204
|
+
"output": "{{v\u000a}}"
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"id": "escaping/option-key-colon",
|
|
209
|
+
"description": "An option key carries a colon as an escape sequence and is compared unescaped.",
|
|
210
|
+
"section": "7",
|
|
211
|
+
"message": "{{v; a\\:b:X; default:D}}",
|
|
212
|
+
"payload": {
|
|
213
|
+
"v": "a:b"
|
|
214
|
+
},
|
|
215
|
+
"expected": {
|
|
216
|
+
"output": "X"
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"id": "escaping/option-key-semicolon",
|
|
221
|
+
"description": "An option key carries a semicolon as an escape sequence and is compared unescaped.",
|
|
222
|
+
"section": "7",
|
|
223
|
+
"message": "{{v; a\\;b:X; default:D}}",
|
|
224
|
+
"payload": {
|
|
225
|
+
"v": "a;b"
|
|
226
|
+
},
|
|
227
|
+
"expected": {
|
|
228
|
+
"output": "X"
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"id": "escaping/option-key-backslash-before-other",
|
|
233
|
+
"description": "A backslash before a non-structural character in an option key stands with it.",
|
|
234
|
+
"section": "7",
|
|
235
|
+
"message": "{{v; a\\xb:X; default:D}}",
|
|
236
|
+
"payload": {
|
|
237
|
+
"v": "a\\xb"
|
|
238
|
+
},
|
|
239
|
+
"expected": {
|
|
240
|
+
"output": "X"
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"id": "escaping/valueless-option-spelling",
|
|
245
|
+
"description": "A valueless option compares by its unescaped key and resolves to its source spelling, unescaped once with the output.",
|
|
246
|
+
"section": "7",
|
|
247
|
+
"message": "{{v; a\\\\\\\\b}}",
|
|
248
|
+
"payload": {
|
|
249
|
+
"v": "a\\\\b"
|
|
250
|
+
},
|
|
251
|
+
"expected": {
|
|
252
|
+
"output": "a\\\\b"
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"id": "escaping/option-value-colon",
|
|
257
|
+
"description": "An escaped colon in an option value is text.",
|
|
258
|
+
"section": "7",
|
|
259
|
+
"message": "{{v; a:10\\:30; default:D}}",
|
|
260
|
+
"payload": {
|
|
261
|
+
"v": "a"
|
|
262
|
+
},
|
|
263
|
+
"expected": {
|
|
264
|
+
"output": "10:30"
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"id": "escaping/option-value-url",
|
|
269
|
+
"description": "An option value keeps every unescaped colon after the first, so a URL survives.",
|
|
270
|
+
"section": "6",
|
|
271
|
+
"message": "{{v; a:http://x; default:D}}",
|
|
272
|
+
"payload": {
|
|
273
|
+
"v": "a"
|
|
274
|
+
},
|
|
275
|
+
"expected": {
|
|
276
|
+
"output": "http://x"
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"id": "escaping/option-value-clock-time",
|
|
281
|
+
"description": "An option value keeps every unescaped colon after the first, so a clock time survives.",
|
|
282
|
+
"section": "6",
|
|
283
|
+
"message": "{{v; a:10:30; default:D}}",
|
|
284
|
+
"payload": {
|
|
285
|
+
"v": "a"
|
|
286
|
+
},
|
|
287
|
+
"expected": {
|
|
288
|
+
"output": "10:30"
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
"id": "escaping/option-value-many-colons",
|
|
293
|
+
"description": "An option value runs to the end of the segment, whatever colons it carries.",
|
|
294
|
+
"section": "6",
|
|
295
|
+
"message": "{{v; a:b:c:d; default:D}}",
|
|
296
|
+
"payload": {
|
|
297
|
+
"v": "a"
|
|
298
|
+
},
|
|
299
|
+
"expected": {
|
|
300
|
+
"output": "b:c:d"
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
"id": "escaping/default-value-colons",
|
|
305
|
+
"description": "An inline default is read like an option value, so it keeps every colon after the first.",
|
|
306
|
+
"section": "9.3",
|
|
307
|
+
"message": "{{v; default:10:30}}",
|
|
308
|
+
"payload": {},
|
|
309
|
+
"expected": {
|
|
310
|
+
"output": "10:30"
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
"id": "escaping/option-value-semicolon",
|
|
315
|
+
"description": "An escaped semicolon in an option value is text and does not end the segment.",
|
|
316
|
+
"section": "7",
|
|
317
|
+
"message": "{{v; 1:a\\;b}}",
|
|
318
|
+
"payload": {
|
|
319
|
+
"v": 1
|
|
320
|
+
},
|
|
321
|
+
"expected": {
|
|
322
|
+
"output": "a;b"
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
"id": "escaping/option-value-escaped-pair",
|
|
327
|
+
"description": "An escaped pair in an option value is still an escape sequence on the next pass, so it is not resolved.",
|
|
328
|
+
"section": "7",
|
|
329
|
+
"message": "{{v; 1:\\{\\{n\\}\\}}}",
|
|
330
|
+
"payload": {
|
|
331
|
+
"v": 1,
|
|
332
|
+
"n": "N"
|
|
333
|
+
},
|
|
334
|
+
"expected": {
|
|
335
|
+
"output": "{{n}}"
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
"id": "escaping/default-semicolons",
|
|
340
|
+
"description": "An escaped semicolon is text at the start, the end and as the whole of an inline default.",
|
|
341
|
+
"section": "7",
|
|
342
|
+
"message": "VALUES: {{value; default:\\;SEMI}}, {{value; default:SEMI\\;}}, {{value; default:\\;}}",
|
|
343
|
+
"payload": {},
|
|
344
|
+
"expected": {
|
|
345
|
+
"output": "VALUES: ;SEMI, SEMI;, ;"
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
"id": "escaping/default-escaped-space",
|
|
350
|
+
"description": "An escaped space writes a space that trimming keeps.",
|
|
351
|
+
"section": "7",
|
|
352
|
+
"message": "[{{v; default:\\ D\\ }}]",
|
|
353
|
+
"payload": {},
|
|
354
|
+
"expected": {
|
|
355
|
+
"output": "[ D ]"
|
|
356
|
+
}
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
"id": "escaping/combined-selected",
|
|
360
|
+
"description": "A key, an option key and an option value all carry escape sequences, and the selected value renders unescaped once.",
|
|
361
|
+
"section": "7",
|
|
362
|
+
"message": "{{va\\:lue; option\\:1:VA\\;\\{\\{LUE\\}\\}\\:1; option\\:2:VA\\;\\{\\{LUE\\}\\}\\:2; default:DEFAULT \\{\\{VALUE\\}\\}\\;}}",
|
|
363
|
+
"payload": {
|
|
364
|
+
"va:lue": "option:1"
|
|
365
|
+
},
|
|
366
|
+
"expected": {
|
|
367
|
+
"output": "VA;{{LUE}}:1"
|
|
368
|
+
}
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
"id": "escaping/combined-default",
|
|
372
|
+
"description": "An inline default carrying escaped delimiters renders them as text.",
|
|
373
|
+
"section": "7",
|
|
374
|
+
"message": "{{va\\:lue; option\\:1:VA\\;\\{\\{LUE\\}\\}\\:1; option\\:2:VA\\;\\{\\{LUE\\}\\}\\:2; default:DEFAULT \\{\\{VALUE\\}\\}\\;}}",
|
|
375
|
+
"payload": {},
|
|
376
|
+
"expected": {
|
|
377
|
+
"output": "DEFAULT {{VALUE}};"
|
|
378
|
+
}
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
"id": "escaping/modifier-name-backslash-before-other",
|
|
382
|
+
"description": "A backslash before a non-structural character in a modifier name stands with it, so the name is not the comparison it resembles.",
|
|
383
|
+
"section": "7",
|
|
384
|
+
"message": "{{v:e\\q; a:X; default:D}}",
|
|
385
|
+
"payload": {
|
|
386
|
+
"v": "a"
|
|
387
|
+
},
|
|
388
|
+
"key": "escaping.modifier-name",
|
|
389
|
+
"expected": {
|
|
390
|
+
"output": "D",
|
|
391
|
+
"reports": [
|
|
392
|
+
{
|
|
393
|
+
"code": "unknown-modifier",
|
|
394
|
+
"origin": "message",
|
|
395
|
+
"key": "escaping.modifier-name"
|
|
396
|
+
}
|
|
397
|
+
]
|
|
398
|
+
}
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
"id": "escaping/modifier-name-escaped-space",
|
|
402
|
+
"description": "A space an escape sequence claims is part of the modifier name, so the name is not the comparison that follows it.",
|
|
403
|
+
"section": "7",
|
|
404
|
+
"message": "{{v:\\ eq; a:X; default:D}}",
|
|
405
|
+
"payload": {
|
|
406
|
+
"v": "a"
|
|
407
|
+
},
|
|
408
|
+
"key": "escaping.modifier-space",
|
|
409
|
+
"expected": {
|
|
410
|
+
"output": "D",
|
|
411
|
+
"reports": [
|
|
412
|
+
{
|
|
413
|
+
"code": "unknown-modifier",
|
|
414
|
+
"origin": "message",
|
|
415
|
+
"key": "escaping.modifier-space"
|
|
416
|
+
}
|
|
417
|
+
]
|
|
418
|
+
}
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
"id": "escaping/value-unescaped-like-message",
|
|
422
|
+
"description": "The text a value converts to is unescaped like the message: an escaped backslash becomes one and a backslash before a letter stands.",
|
|
423
|
+
"section": "7",
|
|
424
|
+
"message": "{{v}}",
|
|
425
|
+
"payload": {
|
|
426
|
+
"v": "\\\\server\\share"
|
|
427
|
+
},
|
|
428
|
+
"expected": {
|
|
429
|
+
"output": "\\server\\share"
|
|
430
|
+
}
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
"id": "escaping/value-removed-once",
|
|
434
|
+
"description": "Escape sequences are removed exactly once, from the final text, never from the result of a pass.",
|
|
435
|
+
"section": "7",
|
|
436
|
+
"message": "{{v}}",
|
|
437
|
+
"payload": {
|
|
438
|
+
"v": "a\\\\\\\\b"
|
|
439
|
+
},
|
|
440
|
+
"expected": {
|
|
441
|
+
"output": "a\\\\b"
|
|
442
|
+
}
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
"id": "escaping/value-escaped-pair",
|
|
446
|
+
"description": "A value containing an escaped opening pair does not become a placeholder.",
|
|
447
|
+
"section": "5",
|
|
448
|
+
"message": "{{v}}",
|
|
449
|
+
"payload": {
|
|
450
|
+
"v": "\\{\\{n\\}\\}",
|
|
451
|
+
"n": "N"
|
|
452
|
+
},
|
|
453
|
+
"expected": {
|
|
454
|
+
"output": "{{n}}"
|
|
455
|
+
}
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
"id": "escaping/value-suppressed-opening-pair",
|
|
459
|
+
"description": "A backslash a value puts before an opening pair is still an escape sequence on the next pass, so the pair does not open.",
|
|
460
|
+
"section": "5",
|
|
461
|
+
"message": "{{v}}",
|
|
462
|
+
"payload": {
|
|
463
|
+
"v": "\\{{n}}",
|
|
464
|
+
"n": "N"
|
|
465
|
+
},
|
|
466
|
+
"expected": {
|
|
467
|
+
"output": "{{n}}"
|
|
468
|
+
}
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
"id": "escaping/value-escaped-backslash-before-pair",
|
|
472
|
+
"description": "An escaped backslash a value introduces is consumed as a pair on the next pass, so the opening pair after it stands and resolves.",
|
|
473
|
+
"section": "5",
|
|
474
|
+
"message": "{{v}}",
|
|
475
|
+
"payload": {
|
|
476
|
+
"v": "\\\\{{n}}",
|
|
477
|
+
"n": "N"
|
|
478
|
+
},
|
|
479
|
+
"expected": {
|
|
480
|
+
"output": "\\N"
|
|
481
|
+
}
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
"id": "escaping/serialization-not-parsable",
|
|
485
|
+
"description": "A serialized value carrying a backslash reaches the output through the single removal, so it is no longer parsable as JSON.",
|
|
486
|
+
"section": "7",
|
|
487
|
+
"message": "{{v}}",
|
|
488
|
+
"payload": {
|
|
489
|
+
"v": {
|
|
490
|
+
"a": "C:\\U"
|
|
491
|
+
}
|
|
492
|
+
},
|
|
493
|
+
"expected": {
|
|
494
|
+
"output": "{\"a\":\"C:\\U\"}"
|
|
495
|
+
}
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
"id": "escaping/serialization-doubled-by-caller",
|
|
499
|
+
"description": "A caller that doubles every backslash of a serialization gets that serialization back from the removal.",
|
|
500
|
+
"section": "7",
|
|
501
|
+
"message": "{{v}}",
|
|
502
|
+
"payload": {
|
|
503
|
+
"v": "{\"a\":\"C:\\\\\\\\U\"}"
|
|
504
|
+
},
|
|
505
|
+
"expected": {
|
|
506
|
+
"output": "{\"a\":\"C:\\\\U\"}"
|
|
507
|
+
}
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
"id": "escaping/option-key-matches-value-before-removal",
|
|
511
|
+
"description": "An option key that spells the value's backslash escaped selects, because the modifier reads the value's text before the removal runs.",
|
|
512
|
+
"section": "7",
|
|
513
|
+
"message": "{{v; a\\\\\\:b:X; default:D}}",
|
|
514
|
+
"payload": {
|
|
515
|
+
"v": "a\\:b"
|
|
516
|
+
},
|
|
517
|
+
"expected": {
|
|
518
|
+
"output": "X"
|
|
519
|
+
}
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
"id": "escaping/option-key-unescaped-value-not",
|
|
523
|
+
"description": "An option key that unescapes to the value's unescaped text does not select, because the value's escape sequence is still there when the modifier compares.",
|
|
524
|
+
"section": "7",
|
|
525
|
+
"message": "{{v; a\\:b:X; default:D}}",
|
|
526
|
+
"payload": {
|
|
527
|
+
"v": "a\\:b"
|
|
528
|
+
},
|
|
529
|
+
"expected": {
|
|
530
|
+
"output": "D"
|
|
531
|
+
}
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
"id": "escaping/escaped-backslash-before-opening-pair",
|
|
535
|
+
"description": "An escaped backslash before the opening pair writes one backslash and leaves the pair to open.",
|
|
536
|
+
"section": "7",
|
|
537
|
+
"message": "\\\\{{v}}",
|
|
538
|
+
"payload": {
|
|
539
|
+
"v": "HIT"
|
|
540
|
+
},
|
|
541
|
+
"expected": {
|
|
542
|
+
"output": "\\HIT"
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
]
|
|
546
|
+
}
|