@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.
@@ -0,0 +1,512 @@
1
+ {
2
+ "format": "curly-message-1",
3
+ "level": "core",
4
+ "section": "14",
5
+ "cases": [
6
+ {
7
+ "id": "reports/missing-options-eq",
8
+ "description": "A comparison named with no options is a message error: the chain, and a missing-options report against the message.",
9
+ "section": "9.5",
10
+ "message": "{{v:eq; default:FALLBACK}}",
11
+ "payload": {
12
+ "v": 10
13
+ },
14
+ "key": "reports.key",
15
+ "expected": {
16
+ "output": "FALLBACK",
17
+ "reports": [
18
+ {
19
+ "code": "missing-options",
20
+ "origin": "message",
21
+ "key": "reports.key"
22
+ }
23
+ ]
24
+ }
25
+ },
26
+ {
27
+ "id": "reports/missing-options-each-comparison",
28
+ "description": "Each of the six comparison modifiers named with no options is reported, one report per placeholder in source order.",
29
+ "section": "9.5",
30
+ "message": "{{v:eq; default:D}}, {{v:ne; default:D}}, {{v:lt; default:D}}, {{v:gt; default:D}}, {{v:lte; default:D}}, {{v:gte; default:D}}",
31
+ "payload": {
32
+ "v": 10
33
+ },
34
+ "key": "reports.key",
35
+ "expected": {
36
+ "output": "D, D, D, D, D, D",
37
+ "reports": [
38
+ {
39
+ "code": "missing-options",
40
+ "origin": "message",
41
+ "key": "reports.key"
42
+ },
43
+ {
44
+ "code": "missing-options",
45
+ "origin": "message",
46
+ "key": "reports.key"
47
+ },
48
+ {
49
+ "code": "missing-options",
50
+ "origin": "message",
51
+ "key": "reports.key"
52
+ },
53
+ {
54
+ "code": "missing-options",
55
+ "origin": "message",
56
+ "key": "reports.key"
57
+ },
58
+ {
59
+ "code": "missing-options",
60
+ "origin": "message",
61
+ "key": "reports.key"
62
+ },
63
+ {
64
+ "code": "missing-options",
65
+ "origin": "message",
66
+ "key": "reports.key"
67
+ }
68
+ ]
69
+ }
70
+ },
71
+ {
72
+ "id": "reports/missing-options-over-present-value",
73
+ "description": "The report turns on what the placeholder declares, so a comparison with no options is reported over a present value.",
74
+ "section": "9.5",
75
+ "message": "{{v:eq}}",
76
+ "payload": {
77
+ "v": 10,
78
+ "default": "CHAIN"
79
+ },
80
+ "key": "reports.key",
81
+ "expected": {
82
+ "output": "CHAIN",
83
+ "reports": [
84
+ {
85
+ "code": "missing-options",
86
+ "origin": "message",
87
+ "key": "reports.key"
88
+ }
89
+ ]
90
+ }
91
+ },
92
+ {
93
+ "id": "reports/missing-options-over-absent-value",
94
+ "description": "A comparison with no options is reported over an absent value alike, though the value takes the chain before any modifier is asked.",
95
+ "section": "9.5",
96
+ "message": "{{v:eq}}",
97
+ "payload": {
98
+ "default": "CHAIN"
99
+ },
100
+ "key": "reports.key",
101
+ "expected": {
102
+ "output": "CHAIN",
103
+ "reports": [
104
+ {
105
+ "code": "missing-options",
106
+ "origin": "message",
107
+ "key": "reports.key"
108
+ }
109
+ ]
110
+ }
111
+ },
112
+ {
113
+ "id": "reports/missing-options-empty-segment",
114
+ "description": "A segment that declares no option leaves the comparison with none, so it is reported.",
115
+ "section": "9.5",
116
+ "message": "{{v:eq;; default:D}}",
117
+ "payload": {
118
+ "v": 10
119
+ },
120
+ "key": "reports.key",
121
+ "expected": {
122
+ "output": "D",
123
+ "reports": [
124
+ {
125
+ "code": "missing-options",
126
+ "origin": "message",
127
+ "key": "reports.key"
128
+ }
129
+ ]
130
+ }
131
+ },
132
+ {
133
+ "id": "reports/one-option-is-no-error",
134
+ "description": "A comparison offered one option is complete, so nothing is reported.",
135
+ "section": "9.5",
136
+ "message": "{{v:eq; 10:TEN; default:FALLBACK}}",
137
+ "payload": {
138
+ "v": 10
139
+ },
140
+ "expected": {
141
+ "output": "TEN",
142
+ "reports": []
143
+ }
144
+ },
145
+ {
146
+ "id": "reports/one-option-absent-value-no-error",
147
+ "description": "A comparison offered an option is complete over an absent value too, so it takes the chain and nothing is reported.",
148
+ "section": "9.5",
149
+ "message": "{{v:eq; 10:TEN}}",
150
+ "payload": {},
151
+ "expected": {
152
+ "output": "",
153
+ "reports": []
154
+ }
155
+ },
156
+ {
157
+ "id": "reports/plain-substitution-is-no-selection",
158
+ "description": "A placeholder naming no modifier and no options is a plain substitution, not a comparison, so nothing is reported.",
159
+ "section": "9.5",
160
+ "message": "{{v}} {{w; default:FALLBACK}}",
161
+ "payload": {
162
+ "v": 10
163
+ },
164
+ "expected": {
165
+ "output": "10 FALLBACK",
166
+ "reports": []
167
+ }
168
+ },
169
+ {
170
+ "id": "reports/no-key-no-selection",
171
+ "description": "A placeholder naming no key is neither a substitution nor a selection, so a comparison it names with no options is not reported.",
172
+ "section": "9.5",
173
+ "message": "{{:eq; default:FALLBACK}}",
174
+ "payload": {
175
+ "v": 10
176
+ },
177
+ "expected": {
178
+ "output": "FALLBACK",
179
+ "reports": []
180
+ }
181
+ },
182
+ {
183
+ "id": "reports/no-key-unknown-modifier",
184
+ "description": "A placeholder naming no key still names its modifier, so one nobody registered is a message error.",
185
+ "section": "9.5",
186
+ "message": "{{:zz}}",
187
+ "payload": {
188
+ "default": "CHAIN"
189
+ },
190
+ "key": "reports.key",
191
+ "expected": {
192
+ "output": "CHAIN",
193
+ "reports": [
194
+ {
195
+ "code": "unknown-modifier",
196
+ "origin": "message",
197
+ "key": "reports.key"
198
+ }
199
+ ]
200
+ }
201
+ },
202
+ {
203
+ "id": "reports/unknown-modifier-takes-chain",
204
+ "description": "An unknown modifier is a message error and never eq: the chain, and an unknown-modifier report against the message.",
205
+ "section": "11.4",
206
+ "message": "{{v:plural; 1:one; default:many}}",
207
+ "payload": {
208
+ "v": 1
209
+ },
210
+ "key": "common.plural",
211
+ "expected": {
212
+ "output": "many",
213
+ "reports": [
214
+ {
215
+ "code": "unknown-modifier",
216
+ "origin": "message",
217
+ "key": "common.plural"
218
+ }
219
+ ]
220
+ }
221
+ },
222
+ {
223
+ "id": "reports/unknown-modifier-without-default",
224
+ "description": "An unknown modifier takes the chain down to the empty string where nothing declares a default, and is reported.",
225
+ "section": "11.4",
226
+ "message": "{{v:plural; 1:one}}",
227
+ "payload": {
228
+ "v": 1
229
+ },
230
+ "key": "reports.key",
231
+ "expected": {
232
+ "output": "",
233
+ "reports": [
234
+ {
235
+ "code": "unknown-modifier",
236
+ "origin": "message",
237
+ "key": "reports.key"
238
+ }
239
+ ]
240
+ }
241
+ },
242
+ {
243
+ "id": "reports/unknown-modifier-over-absent-value",
244
+ "description": "The name is the error, so an unknown modifier is reported over an absent value too.",
245
+ "section": "11.4",
246
+ "message": "{{v:plural; 1:one; default:FALLBACK}}",
247
+ "payload": {},
248
+ "key": "reports.key",
249
+ "expected": {
250
+ "output": "FALLBACK",
251
+ "reports": [
252
+ {
253
+ "code": "unknown-modifier",
254
+ "origin": "message",
255
+ "key": "reports.key"
256
+ }
257
+ ]
258
+ }
259
+ },
260
+ {
261
+ "id": "reports/unregistered-name-is-unknown",
262
+ "description": "A name this format does not specify is unknown until a host registers it, whatever its spelling.",
263
+ "section": "11.4",
264
+ "message": "{{v:x-icon; ok:CHECK; default:FALLBACK}}",
265
+ "payload": {
266
+ "v": "ok"
267
+ },
268
+ "key": "reports.key",
269
+ "expected": {
270
+ "output": "FALLBACK",
271
+ "reports": [
272
+ {
273
+ "code": "unknown-modifier",
274
+ "origin": "message",
275
+ "key": "reports.key"
276
+ }
277
+ ]
278
+ }
279
+ },
280
+ {
281
+ "id": "reports/modifier-names-case-sensitive",
282
+ "description": "Modifier names are case-sensitive: eq is a modifier and EQ is not.",
283
+ "section": "11",
284
+ "message": "{{v:eq; x:X; default:D}}{{v:EQ; x:X; default:D}}",
285
+ "payload": {
286
+ "v": "x"
287
+ },
288
+ "key": "reports.key",
289
+ "expected": {
290
+ "output": "XD",
291
+ "reports": [
292
+ {
293
+ "code": "unknown-modifier",
294
+ "origin": "message",
295
+ "key": "reports.key"
296
+ }
297
+ ]
298
+ }
299
+ },
300
+ {
301
+ "id": "reports/case-variant-is-not-eq",
302
+ "description": "A case variant of a comparison is an unknown modifier, and is not silently treated as eq.",
303
+ "section": "11.4",
304
+ "message": "{{v:GT; 1:ONE; default:D}}",
305
+ "payload": {
306
+ "v": 1
307
+ },
308
+ "key": "reports.key",
309
+ "expected": {
310
+ "output": "D",
311
+ "reports": [
312
+ {
313
+ "code": "unknown-modifier",
314
+ "origin": "message",
315
+ "key": "reports.key"
316
+ }
317
+ ]
318
+ }
319
+ },
320
+ {
321
+ "id": "reports/unserializable-value-origin-payload",
322
+ "description": "A value no conversion can describe is reported as unserializable-value, whose origin is the payload.",
323
+ "section": "14.2",
324
+ "message": "{{v; default:D}}",
325
+ "payload": {
326
+ "v": {
327
+ "$curly": "unserializable"
328
+ }
329
+ },
330
+ "key": "reports.key",
331
+ "expected": {
332
+ "output": "D",
333
+ "reports": [
334
+ {
335
+ "code": "unserializable-value",
336
+ "origin": "payload",
337
+ "key": "reports.key"
338
+ }
339
+ ]
340
+ }
341
+ },
342
+ {
343
+ "id": "reports/unserializable-chain-link-reported",
344
+ "description": "A link of the fallback chain that is present and cannot be described is reported like any payload value, while the message that does not exist is not.",
345
+ "section": "14.2",
346
+ "message": {
347
+ "$curly": "unserializable"
348
+ },
349
+ "payload": {
350
+ "default": {
351
+ "$curly": "unserializable"
352
+ }
353
+ },
354
+ "key": "reports.key",
355
+ "expected": {
356
+ "output": "reports.key",
357
+ "reports": [
358
+ {
359
+ "code": "unserializable-value",
360
+ "origin": "payload",
361
+ "key": "reports.key"
362
+ }
363
+ ]
364
+ }
365
+ },
366
+ {
367
+ "id": "reports/missing-message-not-reported",
368
+ "description": "A message that no conversion can describe does not exist, and stepping past it is not a condition to report.",
369
+ "section": "14.2",
370
+ "message": {
371
+ "$curly": "unserializable"
372
+ },
373
+ "payload": {},
374
+ "key": "reports.key",
375
+ "expected": {
376
+ "output": "reports.key",
377
+ "reports": []
378
+ }
379
+ },
380
+ {
381
+ "id": "reports/one-error-does-not-fail-the-message",
382
+ "description": "A single malformed placeholder takes its chain while the rest of the message renders.",
383
+ "section": "14.2",
384
+ "message": "{{a}} {{v:zz; default:D}} {{b}}",
385
+ "payload": {
386
+ "a": "A",
387
+ "b": "B"
388
+ },
389
+ "key": "reports.key",
390
+ "expected": {
391
+ "output": "A D B",
392
+ "reports": [
393
+ {
394
+ "code": "unknown-modifier",
395
+ "origin": "message",
396
+ "key": "reports.key"
397
+ }
398
+ ]
399
+ }
400
+ },
401
+ {
402
+ "id": "reports/three-placeholders-three-reports",
403
+ "description": "A message naming an unknown modifier at three placeholders reports three times, each report naming the key.",
404
+ "section": "14.3",
405
+ "message": "{{a:zz; default:A}}{{b:zz; default:B}}{{c:zz; default:C}}",
406
+ "payload": {},
407
+ "key": "reports.key",
408
+ "expected": {
409
+ "output": "ABC",
410
+ "reports": [
411
+ {
412
+ "code": "unknown-modifier",
413
+ "origin": "message",
414
+ "key": "reports.key"
415
+ },
416
+ {
417
+ "code": "unknown-modifier",
418
+ "origin": "message",
419
+ "key": "reports.key"
420
+ },
421
+ {
422
+ "code": "unknown-modifier",
423
+ "origin": "message",
424
+ "key": "reports.key"
425
+ }
426
+ ]
427
+ }
428
+ },
429
+ {
430
+ "id": "reports/later-pass-reports-again",
431
+ "description": "A placeholder a later pass finds again, because a value carried it, met the condition again and is reported again.",
432
+ "section": "14.3",
433
+ "message": "{{v:zz; default:D}} {{w}}",
434
+ "payload": {
435
+ "w": "{{v:zz; default:D}}"
436
+ },
437
+ "key": "reports.key",
438
+ "expected": {
439
+ "output": "D D",
440
+ "reports": [
441
+ {
442
+ "code": "unknown-modifier",
443
+ "origin": "message",
444
+ "key": "reports.key"
445
+ },
446
+ {
447
+ "code": "unknown-modifier",
448
+ "origin": "message",
449
+ "key": "reports.key"
450
+ }
451
+ ]
452
+ }
453
+ },
454
+ {
455
+ "id": "reports/source-order-within-a-pass",
456
+ "description": "Within a pass, reports follow the placeholders in source order.",
457
+ "section": "14.3",
458
+ "message": "{{a:zz; default:A}}{{b:eq; default:B}}{{u; default:U}}",
459
+ "payload": {
460
+ "u": {
461
+ "$curly": "unserializable"
462
+ }
463
+ },
464
+ "key": "reports.key",
465
+ "expected": {
466
+ "output": "ABU",
467
+ "reports": [
468
+ {
469
+ "code": "unknown-modifier",
470
+ "origin": "message",
471
+ "key": "reports.key"
472
+ },
473
+ {
474
+ "code": "missing-options",
475
+ "origin": "message",
476
+ "key": "reports.key"
477
+ },
478
+ {
479
+ "code": "unserializable-value",
480
+ "origin": "payload",
481
+ "key": "reports.key"
482
+ }
483
+ ]
484
+ }
485
+ },
486
+ {
487
+ "id": "reports/pass-order-before-source-order",
488
+ "description": "A report is emitted in the pass where the condition was met, so a placeholder found on the second pass reports after one met on the first however the two sit in the text.",
489
+ "section": "14.3",
490
+ "message": "{{w}}{{a:zz; default:A}}",
491
+ "payload": {
492
+ "w": "{{b:eq; default:B}}"
493
+ },
494
+ "key": "reports.key",
495
+ "expected": {
496
+ "output": "BA",
497
+ "reports": [
498
+ {
499
+ "code": "unknown-modifier",
500
+ "origin": "message",
501
+ "key": "reports.key"
502
+ },
503
+ {
504
+ "code": "missing-options",
505
+ "origin": "message",
506
+ "key": "reports.key"
507
+ }
508
+ ]
509
+ }
510
+ }
511
+ ]
512
+ }