@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,774 @@
1
+ {
2
+ "format": "curly-message-1",
3
+ "level": "core",
4
+ "section": "10",
5
+ "cases": [
6
+ {
7
+ "id": "fallback/table-value-present",
8
+ "description": "A placeholder that resolves to a value never reaches the chain, whatever defaults are declared.",
9
+ "section": "10",
10
+ "message": "Hello, {{name; default:Guest;}}!",
11
+ "payload": {
12
+ "name": "Alice",
13
+ "default": "Friend"
14
+ },
15
+ "expected": {
16
+ "output": "Hello, Alice!"
17
+ }
18
+ },
19
+ {
20
+ "id": "fallback/table-empty-value",
21
+ "description": "The empty string is a value and not a missing one, so the chain is not read.",
22
+ "section": "10",
23
+ "message": "Hello, {{name; default:Guest;}}!",
24
+ "payload": {
25
+ "name": "",
26
+ "default": "Friend"
27
+ },
28
+ "expected": {
29
+ "output": "Hello, !"
30
+ }
31
+ },
32
+ {
33
+ "id": "fallback/table-wrapper-default",
34
+ "description": "A wrapper without a value takes its own default over the payload default and the inline one.",
35
+ "section": "10",
36
+ "message": "Hello, {{name; default:Guest;}}!",
37
+ "payload": {
38
+ "name": {
39
+ "default": "You"
40
+ },
41
+ "default": "Friend"
42
+ },
43
+ "expected": {
44
+ "output": "Hello, You!"
45
+ }
46
+ },
47
+ {
48
+ "id": "fallback/table-payload-default",
49
+ "description": "The payload outranks the message: its own default takes precedence over the inline one.",
50
+ "section": "10",
51
+ "message": "Hello, {{name; default:Guest;}}!",
52
+ "payload": {
53
+ "default": "Friend"
54
+ },
55
+ "expected": {
56
+ "output": "Hello, Friend!"
57
+ }
58
+ },
59
+ {
60
+ "id": "fallback/table-inline-default",
61
+ "description": "The inline default answers where the payload declares neither a wrapper default nor its own.",
62
+ "section": "10",
63
+ "message": "Hello, {{name; default:Guest;}}!",
64
+ "payload": {},
65
+ "expected": {
66
+ "output": "Hello, Guest!"
67
+ }
68
+ },
69
+ {
70
+ "id": "fallback/empty-string-last",
71
+ "description": "Where no link yields text the placeholder resolves to the empty string, the last link of the chain.",
72
+ "section": "10",
73
+ "message": "[{{v}}]",
74
+ "payload": {},
75
+ "expected": {
76
+ "output": "[]"
77
+ }
78
+ },
79
+ {
80
+ "id": "fallback/wrapper-without-default-skipped",
81
+ "description": "A wrapper whose value is the host's undefined and that declares no default is an absent first link, so the payload default answers.",
82
+ "section": "10",
83
+ "message": "{{v; default:INLINE}}",
84
+ "payload": {
85
+ "v": {
86
+ "value": {
87
+ "$curly": "undefined"
88
+ }
89
+ },
90
+ "default": "PAYLOAD"
91
+ },
92
+ "expected": {
93
+ "output": "PAYLOAD"
94
+ }
95
+ },
96
+ {
97
+ "id": "fallback/wrapper-default-undefined-skipped",
98
+ "description": "A wrapper default that is the host's undefined is absent: it is skipped and nothing is reported.",
99
+ "section": "10",
100
+ "message": "{{v; default:INLINE}}",
101
+ "payload": {
102
+ "v": {
103
+ "default": {
104
+ "$curly": "undefined"
105
+ }
106
+ },
107
+ "default": "PAYLOAD"
108
+ },
109
+ "key": "fallback.wrapper-undefined",
110
+ "expected": {
111
+ "output": "PAYLOAD",
112
+ "reports": []
113
+ }
114
+ },
115
+ {
116
+ "id": "fallback/payload-default-undefined-skipped",
117
+ "description": "A payload default that is the host's undefined is absent: it is skipped without a report and the inline default answers.",
118
+ "section": "10",
119
+ "message": "{{v; default:INLINE}}",
120
+ "payload": {
121
+ "default": {
122
+ "$curly": "undefined"
123
+ }
124
+ },
125
+ "key": "fallback.payload-undefined",
126
+ "expected": {
127
+ "output": "INLINE",
128
+ "reports": []
129
+ }
130
+ },
131
+ {
132
+ "id": "fallback/wrapper-default-undescribable-skipped",
133
+ "description": "A wrapper default no conversion can describe is skipped and reported against the payload, and the payload default answers.",
134
+ "section": "14.2",
135
+ "message": "{{v; default:INLINE}}",
136
+ "payload": {
137
+ "v": {
138
+ "default": {
139
+ "$curly": "unserializable"
140
+ }
141
+ },
142
+ "default": "PAYLOAD"
143
+ },
144
+ "key": "fallback.wrapper-undescribable",
145
+ "expected": {
146
+ "output": "PAYLOAD",
147
+ "reports": [
148
+ {
149
+ "code": "unserializable-value",
150
+ "origin": "payload",
151
+ "key": "fallback.wrapper-undescribable"
152
+ }
153
+ ]
154
+ }
155
+ },
156
+ {
157
+ "id": "fallback/two-undescribable-links-reported",
158
+ "description": "Every present link that cannot be described is skipped and reported in turn, and the inline default answers.",
159
+ "section": "14.2",
160
+ "message": "{{v; default:INLINE}}",
161
+ "payload": {
162
+ "v": {
163
+ "default": {
164
+ "$curly": "unserializable"
165
+ }
166
+ },
167
+ "default": {
168
+ "$curly": "unserializable"
169
+ }
170
+ },
171
+ "key": "fallback.two-undescribable",
172
+ "expected": {
173
+ "output": "INLINE",
174
+ "reports": [
175
+ {
176
+ "code": "unserializable-value",
177
+ "origin": "payload",
178
+ "key": "fallback.two-undescribable"
179
+ },
180
+ {
181
+ "code": "unserializable-value",
182
+ "origin": "payload",
183
+ "key": "fallback.two-undescribable"
184
+ }
185
+ ]
186
+ }
187
+ },
188
+ {
189
+ "id": "fallback/all-links-undescribable-empty",
190
+ "description": "Where every declared link is undescribable the chain ends at the empty string, each link reported.",
191
+ "section": "10",
192
+ "message": "[{{v}}]",
193
+ "payload": {
194
+ "v": {
195
+ "default": {
196
+ "$curly": "unserializable"
197
+ }
198
+ },
199
+ "default": {
200
+ "$curly": "unserializable"
201
+ }
202
+ },
203
+ "key": "fallback.all-undescribable",
204
+ "expected": {
205
+ "output": "[]",
206
+ "reports": [
207
+ {
208
+ "code": "unserializable-value",
209
+ "origin": "payload",
210
+ "key": "fallback.all-undescribable"
211
+ },
212
+ {
213
+ "code": "unserializable-value",
214
+ "origin": "payload",
215
+ "key": "fallback.all-undescribable"
216
+ }
217
+ ]
218
+ }
219
+ },
220
+ {
221
+ "id": "fallback/wrapper-value-undescribable-takes-wrapper-default",
222
+ "description": "A wrapper value no conversion can describe is absent, and the wrapper's own default is the first link.",
223
+ "section": "10",
224
+ "message": "{{v}}",
225
+ "payload": {
226
+ "v": {
227
+ "value": {
228
+ "$curly": "unserializable"
229
+ },
230
+ "default": "W"
231
+ }
232
+ },
233
+ "key": "fallback.wrapper-value",
234
+ "expected": {
235
+ "output": "W",
236
+ "reports": [
237
+ {
238
+ "code": "unserializable-value",
239
+ "origin": "payload",
240
+ "key": "fallback.wrapper-value"
241
+ }
242
+ ]
243
+ }
244
+ },
245
+ {
246
+ "id": "fallback/empty-wrapper-default-is-text",
247
+ "description": "An empty wrapper default yields text and is taken: only an absent or undescribable link is skipped.",
248
+ "section": "10",
249
+ "message": "[{{v; default:INLINE}}]",
250
+ "payload": {
251
+ "v": {
252
+ "default": ""
253
+ },
254
+ "default": "PAYLOAD"
255
+ },
256
+ "expected": {
257
+ "output": "[]"
258
+ }
259
+ },
260
+ {
261
+ "id": "fallback/payload-default-zero",
262
+ "description": "A payload default of zero is present and renders as zero.",
263
+ "section": "10",
264
+ "message": "{{v}}",
265
+ "payload": {
266
+ "default": 0
267
+ },
268
+ "expected": {
269
+ "output": "0"
270
+ }
271
+ },
272
+ {
273
+ "id": "fallback/payload-default-zero-outranks-inline",
274
+ "description": "A payload default of zero is present, so it outranks the inline default.",
275
+ "section": "10",
276
+ "message": "{{count; default:INLINE}}",
277
+ "payload": {
278
+ "default": 0
279
+ },
280
+ "expected": {
281
+ "output": "0"
282
+ }
283
+ },
284
+ {
285
+ "id": "fallback/value-present-leaves-chain-unread",
286
+ "description": "A placeholder that resolves to a value never reaches the chain, so an undescribable link behind it is not reported.",
287
+ "section": "10",
288
+ "message": "{{v}}",
289
+ "payload": {
290
+ "v": "x",
291
+ "default": {
292
+ "$curly": "unserializable"
293
+ }
294
+ },
295
+ "key": "fallback.unread",
296
+ "expected": {
297
+ "output": "x",
298
+ "reports": []
299
+ }
300
+ },
301
+ {
302
+ "id": "fallback/selection-match-leaves-chain-unread",
303
+ "description": "A modifier that answers without its default leaves the chain unread, so an undescribable link is not reported.",
304
+ "section": "10",
305
+ "message": "{{v:eq; q:Q; default:INLINE}}",
306
+ "payload": {
307
+ "v": "q",
308
+ "default": {
309
+ "$curly": "unserializable"
310
+ }
311
+ },
312
+ "key": "fallback.unread-selection",
313
+ "expected": {
314
+ "output": "Q",
315
+ "reports": []
316
+ }
317
+ },
318
+ {
319
+ "id": "fallback/payload-default-serves-every-placeholder",
320
+ "description": "The payload default is the fallback for every placeholder in the message that resolves to no value.",
321
+ "section": "9.3",
322
+ "message": "Hi {{name; default:friend}}, you have {{count; default:no}} messages",
323
+ "payload": {
324
+ "name": "Ann",
325
+ "default": "-"
326
+ },
327
+ "expected": {
328
+ "output": "Hi Ann, you have - messages"
329
+ }
330
+ },
331
+ {
332
+ "id": "fallback/wrapper-default-serves-its-own-placeholder",
333
+ "description": "A wrapper default is the first link only of the placeholder whose entry the wrapper was.",
334
+ "section": "10",
335
+ "message": "{{a}} {{b}}",
336
+ "payload": {
337
+ "a": {
338
+ "default": "WA"
339
+ },
340
+ "default": "PAYLOAD"
341
+ },
342
+ "expected": {
343
+ "output": "WA PAYLOAD"
344
+ }
345
+ },
346
+ {
347
+ "id": "fallback/default-placeholder-reads-payload-default",
348
+ "description": "A placeholder naming default reads the payload's reserved default rather than a placeholder of its own.",
349
+ "section": "9.3",
350
+ "message": "{{default}}",
351
+ "payload": {
352
+ "default": "D"
353
+ },
354
+ "expected": {
355
+ "output": "D"
356
+ }
357
+ },
358
+ {
359
+ "id": "fallback/default-placeholder-undescribable-reported-once",
360
+ "description": "A placeholder naming default reads the one entry once, so an undescribable default is reported once and the chain ends empty.",
361
+ "section": "9.3",
362
+ "message": "{{default}}",
363
+ "payload": {
364
+ "default": {
365
+ "$curly": "unserializable"
366
+ }
367
+ },
368
+ "key": "fallback.default-once",
369
+ "expected": {
370
+ "output": "",
371
+ "reports": [
372
+ {
373
+ "code": "unserializable-value",
374
+ "origin": "payload",
375
+ "key": "fallback.default-once"
376
+ }
377
+ ]
378
+ }
379
+ },
380
+ {
381
+ "id": "fallback/default-selection-reads-same-fallback",
382
+ "description": "A selection naming default that matches no option falls back to the same entry it read as its value.",
383
+ "section": "9.3",
384
+ "message": "{{default:eq; z:Z}}",
385
+ "payload": {
386
+ "default": "abc"
387
+ },
388
+ "expected": {
389
+ "output": "abc"
390
+ }
391
+ },
392
+ {
393
+ "id": "fallback/shared-link-reported-per-placeholder",
394
+ "description": "One report is emitted for each placeholder that met the condition, so two placeholders reading one undescribable link report twice.",
395
+ "section": "14.3",
396
+ "message": "{{v}}{{w}}",
397
+ "payload": {
398
+ "default": {
399
+ "$curly": "unserializable"
400
+ }
401
+ },
402
+ "key": "fallback.shared-link",
403
+ "expected": {
404
+ "output": "",
405
+ "reports": [
406
+ {
407
+ "code": "unserializable-value",
408
+ "origin": "payload",
409
+ "key": "fallback.shared-link"
410
+ },
411
+ {
412
+ "code": "unserializable-value",
413
+ "origin": "payload",
414
+ "key": "fallback.shared-link"
415
+ }
416
+ ]
417
+ }
418
+ },
419
+ {
420
+ "id": "fallback/root-default-wrapper-shaped-is-value",
421
+ "description": "The payload's root default entry is an ordinary value, never a wrapper, so a wrapper-shaped one serializes.",
422
+ "section": "4.1",
423
+ "message": "{{v}}",
424
+ "payload": {
425
+ "default": {
426
+ "value": "X"
427
+ }
428
+ },
429
+ "expected": {
430
+ "output": "{\"value\":\"X\"}"
431
+ }
432
+ },
433
+ {
434
+ "id": "fallback/missing-message-takes-payload-default",
435
+ "description": "A message the caller did not supply takes the payload's own default first.",
436
+ "section": "10",
437
+ "message": {
438
+ "$curly": "undefined"
439
+ },
440
+ "payload": {
441
+ "default": "D"
442
+ },
443
+ "key": "greeting",
444
+ "expected": {
445
+ "output": "D"
446
+ }
447
+ },
448
+ {
449
+ "id": "fallback/missing-message-echoes-key",
450
+ "description": "A message the caller did not supply echoes its key where the payload declares no default.",
451
+ "section": "10",
452
+ "message": {
453
+ "$curly": "undefined"
454
+ },
455
+ "payload": {},
456
+ "key": "greeting",
457
+ "expected": {
458
+ "output": "greeting"
459
+ }
460
+ },
461
+ {
462
+ "id": "fallback/missing-message-default-zero",
463
+ "description": "A payload default of zero is present, so a missing message takes it rather than echoing the key.",
464
+ "section": "10",
465
+ "message": {
466
+ "$curly": "undefined"
467
+ },
468
+ "payload": {
469
+ "default": 0
470
+ },
471
+ "key": "greeting",
472
+ "expected": {
473
+ "output": "0"
474
+ }
475
+ },
476
+ {
477
+ "id": "fallback/missing-message-default-empty",
478
+ "description": "An empty payload default is present, so a missing message takes it rather than echoing the key.",
479
+ "section": "10",
480
+ "message": {
481
+ "$curly": "undefined"
482
+ },
483
+ "payload": {
484
+ "default": ""
485
+ },
486
+ "key": "greeting",
487
+ "expected": {
488
+ "output": ""
489
+ }
490
+ },
491
+ {
492
+ "id": "fallback/missing-message-default-undefined",
493
+ "description": "A payload default that is the host's undefined is absent: a missing message steps past it to the key without a report.",
494
+ "section": "10",
495
+ "message": {
496
+ "$curly": "undefined"
497
+ },
498
+ "payload": {
499
+ "default": {
500
+ "$curly": "undefined"
501
+ }
502
+ },
503
+ "key": "greeting",
504
+ "expected": {
505
+ "output": "greeting",
506
+ "reports": []
507
+ }
508
+ },
509
+ {
510
+ "id": "fallback/missing-message-default-undescribable",
511
+ "description": "A payload default no conversion can describe does not displace the key echo, and is reported like any payload value.",
512
+ "section": "14.2",
513
+ "message": {
514
+ "$curly": "undefined"
515
+ },
516
+ "payload": {
517
+ "default": {
518
+ "$curly": "unserializable"
519
+ }
520
+ },
521
+ "key": "greeting",
522
+ "expected": {
523
+ "output": "greeting",
524
+ "reports": [
525
+ {
526
+ "code": "unserializable-value",
527
+ "origin": "payload",
528
+ "key": "greeting"
529
+ }
530
+ ]
531
+ }
532
+ },
533
+ {
534
+ "id": "fallback/missing-message-no-key",
535
+ "description": "Where the caller named no key there is nothing to echo, and a missing message resolves to the empty string.",
536
+ "section": "10",
537
+ "message": {
538
+ "$curly": "undefined"
539
+ },
540
+ "payload": {},
541
+ "expected": {
542
+ "output": ""
543
+ }
544
+ },
545
+ {
546
+ "id": "fallback/missing-message-no-key-undescribable-default",
547
+ "description": "An undescribable payload default is reported even where no key remains to echo, and the message resolves to the empty string.",
548
+ "section": "10",
549
+ "message": {
550
+ "$curly": "undefined"
551
+ },
552
+ "payload": {
553
+ "default": {
554
+ "$curly": "unserializable"
555
+ }
556
+ },
557
+ "expected": {
558
+ "output": "",
559
+ "reports": [
560
+ {
561
+ "code": "unserializable-value",
562
+ "origin": "payload"
563
+ }
564
+ ]
565
+ }
566
+ },
567
+ {
568
+ "id": "fallback/empty-message-exists",
569
+ "description": "An empty message exists and resolves to nothing: neither the payload default nor the key displaces it.",
570
+ "section": "10",
571
+ "message": "",
572
+ "payload": {
573
+ "default": "CHAIN"
574
+ },
575
+ "key": "greeting",
576
+ "expected": {
577
+ "output": ""
578
+ }
579
+ },
580
+ {
581
+ "id": "fallback/zero-message-exists",
582
+ "description": "A message that is zero exists and resolves as the text it converts to.",
583
+ "section": "10",
584
+ "message": 0,
585
+ "payload": {
586
+ "default": "CHAIN"
587
+ },
588
+ "key": "greeting",
589
+ "expected": {
590
+ "output": "0"
591
+ }
592
+ },
593
+ {
594
+ "id": "fallback/object-message-exists",
595
+ "description": "A message a conversion describes exists: a plain object resolves as its serialization.",
596
+ "section": "10",
597
+ "message": {
598
+ "a": 1
599
+ },
600
+ "payload": {
601
+ "default": "CHAIN"
602
+ },
603
+ "key": "greeting",
604
+ "expected": {
605
+ "output": "{\"a\":1}"
606
+ }
607
+ },
608
+ {
609
+ "id": "fallback/undescribable-message-takes-payload-default",
610
+ "description": "A message no conversion can describe does not exist, so the payload default takes its place.",
611
+ "section": "10",
612
+ "message": {
613
+ "$curly": "unserializable"
614
+ },
615
+ "payload": {
616
+ "default": "D"
617
+ },
618
+ "key": "greeting",
619
+ "expected": {
620
+ "output": "D",
621
+ "reports": []
622
+ }
623
+ },
624
+ {
625
+ "id": "fallback/undescribable-message-nothing-to-echo",
626
+ "description": "A message no conversion can describe, with no payload default and no key, resolves to the empty string.",
627
+ "section": "10",
628
+ "message": {
629
+ "$curly": "unserializable"
630
+ },
631
+ "expected": {
632
+ "output": "",
633
+ "reports": []
634
+ }
635
+ },
636
+ {
637
+ "id": "fallback/existing-message-leaves-link-unread",
638
+ "description": "A message that exists resolves normally, so the payload default behind it is neither read nor reported.",
639
+ "section": "10",
640
+ "message": "MESSAGE",
641
+ "payload": {
642
+ "default": {
643
+ "$curly": "unserializable"
644
+ }
645
+ },
646
+ "key": "greeting",
647
+ "expected": {
648
+ "output": "MESSAGE",
649
+ "reports": []
650
+ }
651
+ },
652
+ {
653
+ "id": "fallback/key-echo-not-resolved",
654
+ "description": "A key carrying a placeholder is echoed verbatim, not resolved over the payload.",
655
+ "section": "10",
656
+ "message": {
657
+ "$curly": "undefined"
658
+ },
659
+ "payload": {
660
+ "name": "Alice"
661
+ },
662
+ "key": "{{name}}",
663
+ "expected": {
664
+ "output": "{{name}}",
665
+ "reports": []
666
+ }
667
+ },
668
+ {
669
+ "id": "fallback/key-echo-no-payload",
670
+ "description": "A key carrying a placeholder is echoed verbatim where there is no payload at all.",
671
+ "section": "10",
672
+ "message": {
673
+ "$curly": "undefined"
674
+ },
675
+ "key": "{{name}}",
676
+ "expected": {
677
+ "output": "{{name}}"
678
+ }
679
+ },
680
+ {
681
+ "id": "fallback/key-echo-not-unescaped",
682
+ "description": "An escape sequence a key carries is not removed: the key leaves as the application spelled it.",
683
+ "section": "10",
684
+ "message": {
685
+ "$curly": "undefined"
686
+ },
687
+ "key": "a\\;b",
688
+ "expected": {
689
+ "output": "a\\;b"
690
+ }
691
+ },
692
+ {
693
+ "id": "fallback/key-echo-reads-nothing-behind",
694
+ "description": "Nothing behind the key is read on its account: a key naming a self-referential entry is echoed and no limit is reached.",
695
+ "section": "10",
696
+ "message": {
697
+ "$curly": "undefined"
698
+ },
699
+ "payload": {
700
+ "a": "{{a}}"
701
+ },
702
+ "key": "{{a}}",
703
+ "expected": {
704
+ "output": "{{a}}",
705
+ "reports": []
706
+ }
707
+ },
708
+ {
709
+ "id": "fallback/key-echo-ends-the-chain",
710
+ "description": "The echo ends the chain: the undescribable payload default is read once and reported once, and the key is not resolved over it.",
711
+ "section": "10",
712
+ "message": {
713
+ "$curly": "undefined"
714
+ },
715
+ "payload": {
716
+ "default": {
717
+ "$curly": "unserializable"
718
+ }
719
+ },
720
+ "key": "{{name}}",
721
+ "expected": {
722
+ "output": "{{name}}",
723
+ "reports": [
724
+ {
725
+ "code": "unserializable-value",
726
+ "origin": "payload",
727
+ "key": "{{name}}"
728
+ }
729
+ ]
730
+ }
731
+ },
732
+ {
733
+ "id": "fallback/key-number-becomes-text",
734
+ "description": "A key a host wrote as a number is echoed as the text it converts to.",
735
+ "section": "10",
736
+ "message": {
737
+ "$curly": "undefined"
738
+ },
739
+ "key": 42,
740
+ "expected": {
741
+ "output": "42"
742
+ }
743
+ },
744
+ {
745
+ "id": "fallback/key-object-serializes",
746
+ "description": "A key a host wrote as a plain object is echoed as its serialization.",
747
+ "section": "10",
748
+ "message": {
749
+ "$curly": "undefined"
750
+ },
751
+ "key": {
752
+ "a": 1
753
+ },
754
+ "expected": {
755
+ "output": "{\"a\":1}"
756
+ }
757
+ },
758
+ {
759
+ "id": "fallback/key-undescribable-echoes-nothing",
760
+ "description": "A key no conversion can describe leaves nothing to echo, and a key is not reported.",
761
+ "section": "10",
762
+ "message": {
763
+ "$curly": "undefined"
764
+ },
765
+ "key": {
766
+ "$curly": "unserializable"
767
+ },
768
+ "expected": {
769
+ "output": "",
770
+ "reports": []
771
+ }
772
+ }
773
+ ]
774
+ }