/
jsync.data
113 lines (113 loc) · 7.27 KB
/
jsync.data
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
[[
"JSYNC test vector file.",
"",
"This was written for Niecza Perl 6, but it is intended to be reusable.",
"It is encoded in a subset of JSYNC; mapping nodes are not used, nor are",
"anchors, tags, or stream encapsulation. The top sequence",
"node of this file consists of a documentation node, then a sequence of",
"tuples. Each tuple has four elements, a short stable name, an input",
"text, an output text, and a comment.",
"",
"The output text is written in a very canonical form. Every mapping and",
"sequence node has an anchor, which consists of an A followed by a",
"decimal number increasing from 0. Hash keys are in alphabetical order",
"by semantic content, with & and ! at the beginning. No whitespace is",
"used between tokens, and all strings are encoded in the unique shortest",
"form. If the input text is erroneous, the output will be empty.",
"",
"This file is aimed primarily at 'pure' implementations of JSYNC, where",
"tag resolution isn't done and scalars are manipulated as strings. An",
"implementation of JSYNC with an integrated composer will necessarily",
"fail some of these tests."
]
,["TOP000","","","Nothing is illegal"]
,["TOP001"," ","","Only whitespace is illegal"]
,["TOP002","[][]","","Multiple objects are illegal"]
,["TOP003","{}{}","","Multiple hashes are illegal"]
,["TOP004","12","","Bare scalars are illegal (numeric)"]
,["TOP005","\"foo\"","","Bare strings are illegal"]
,["TOP006","true","","Bare true is illegal"]
,["TOP007","false","","Bare false is illegal"]
,["TOP008","null","","Bare null is illegal"]
,["CAP000","[{\"%JSYNC\":\"1.0\"},5]","[{\"%JSYNC\":\"1.0\"},5]","Scalars are legal in a wrapper"]
,["CAP001","[{\"%JSYNC\":\"2.0\"},null]","","JSYNC > 1.x is an error"]
,["CAP002","[{\"%JSYNC\":\"1.0\"}]","","Encapsulation must carry a document"]
,["CAP003","[{\"%JSYNC\":\"1.0\"},1,2]","","Encapsulation must only carry one document"]
,["CAP004","[{\"%JSYNC\":\"1.0\",\"foo\":1},1]","","Non-directives are an error"]
,["CAP005","[{\"%JSYNC\":\"1.0\",\"%FOO\":1},1]","","Undefined directives are an error"]
,["CAP006","[{\"%JSYNC\":\"1.0\"},[]]","[\"&A0\"]","Encapsulation can be removed from aggregates"]
,["CAP007"," [ { \"%JSYNC\":\"1.0\" }, []]","[\"&A0\"]","Encapsulation works with spaces"]
,["CAP008","[{\"\\u0025\\u004A\\u0053\\u0059\\u004E\\u0043\":\"1.0\"},[]]","[\"&A0\"]","Encapsulation works with escapes"]
,["WHT000"," []","[\"&A0\"]","SPACE is white space"]
,["WHT001","\t[]","[\"&A0\"]","HT is white space"]
,["WHT002","\r[]","[\"&A0\"]","CR is white space"]
,["WHT003","\n[]","[\"&A0\"]","LF is white space"]
,["WHT004","\u0000[]","","NUL is not white space at beginning"]
,["WHT005","[]\u0000","","NUL is not white space at end"]
,["WHT006","\u00A0[]","","U+0080 NO-BREAK SPACE is not space"]
,["WHT007","\u1680[]","","U+1680 OGHAM SPACE MARK is not space"]
,["WHT008","\u180E[]","","U+180E MONGOLIAN VOWEL SEPARATOR is not space"]
,["WHT009","\u2000[]","","U+2000 EN QUAD is not space"]
,["WHT010","\u3000[]","","U+3000 IDEOGRAPHIC SPACE is not space"]
,["KWD000","[true]","[\"&A0\",true]","true round trips"]
,["KWD001","[false]","[\"&A0\",false]","false round trips"]
,["KWD002","[null]","[\"&A0\",null]","null round trips"]
,["KWD003","[undef]","","undef is not a keyword"]
,["KWD004","[fails]","","misspelling keyword after first character caught"]
,["STR000","[\"\"]","[\"&A0\",\"\"]","empty string is legal"]
,["STR001","[\"aA0+~\"]","[\"&A0\",\"aA0+~\"]","printable ASCII chars need no escape"]
,["STR002","[\"\u3081\"]","[\"&A0\",\"\u3081\"]","printable non-ASCII chars not escaped"]
,["STR003","[\"\uFFFE\"]","[\"&A0\",\"\uFFFE\"]","nonprintable characters above 256 also raw"]
,["STR004","[\"\\uFFFE\"]","[\"&A0\",\"\uFFFE\"]","\\u escape can encode Unicode chars"]
,["STR005","[\"\\u000A\"]","[\"&A0\",\"\\n\"]","000A returns as n"]
,["STR006","[\"\\u000D\"]","[\"&A0\",\"\\r\"]","000D returns as r"]
,["STR007","[\"\\u0008\"]","[\"&A0\",\"\\b\"]","0008 returns as b"]
,["STR008","[\"\\u000C\"]","[\"&A0\",\"\\f\"]","000C returns as f"]
,["STR009","[\"\\u0009\"]","[\"&A0\",\"\\t\"]","0009 returns as t"]
,["STR010","[\"\\u0022\"]","[\"&A0\",\"\\\"\"]","0022 returns as \\\""]
,["STR011","[\"\\u005C\"]","[\"&A0\",\"\\\\\"]","005C returns as \\\\"]
,["STR012","[\"\\u0019\"]","[\"&A0\",\"\\u0019\"]","Other C0 return as Unicode escape"]
,["STR013","[\"\\u0099\"]","[\"&A0\",\"\\u0099\"]","Other C1 return as Unicode escape"]
,["STR014","[\"\\u0041\"]","[\"&A0\",\"A\"]","Printables return verbatim"]
,["STR015","[\"\\b\"]","[\"&A0\",\"\\b\"]","\\b round trips"]
,["STR016","[\"\\f\"]","[\"&A0\",\"\\f\"]","\\f round trips"]
,["STR017","[\"\\n\"]","[\"&A0\",\"\\n\"]","\\n round trips"]
,["STR018","[\"\\r\"]","[\"&A0\",\"\\r\"]","\\r round trips"]
,["STR020","[\"\\t\"]","[\"&A0\",\"\\t\"]","\\t round trips"]
,["STR021","[\"\\\\\"]","[\"&A0\",\"\\\\\"]","\\\\ round trips"]
,["STR022","[\"\\\"\"]","[\"&A0\",\"\\\"\"]","\\\" round trips"]
,["STR023","[\"\\/\"]","[\"&A0\",\"/\"]","\\/ returns as verbatim char"]
,["STR024","[\".&\"]","[\"&A0\",\".&\"]",".& stuffing round trip"]
,["STR025","[\".*\"]","[\"&A0\",\".*\"]",".* stuffing round trip"]
,["STR026","[\".!\"]","[\"&A0\",\".!\"]",".! stuffing round trip"]
,["STR027","[\".%\"]","[\"&A0\",\".%\"]",".% stuffing round trip"]
,["STR028","[\"..&\"]","[\"&A0\",\"..&\"]","..& stuffing round trip"]
,["STR029","[\"..*\"]","[\"&A0\",\"..*\"]","..* stuffing round trip"]
,["STR030","[\"..!\"]","[\"&A0\",\"..!\"]","..! stuffing round trip"]
,["STR031","[\"..%\"]","[\"&A0\",\"..%\"]","..% stuffing round trip"]
,["STR032","[\".1\"]","[\"&A0\",\".1\"]",".1 non-stuffing round trip"]
,["STR033","[\".@\"]","[\"&A0\",\".@\"]",".@ non-stuffing round trip"]
,["SEQ000","[]","[\"&A0\"]","Array with no elements is legal"]
,["SEQ001","[ ]","[\"&A0\"]","Can put whitespace inside"]
,["SEQ002","[1]","[\"&A0\",1]","One element works"]
,["SEQ003","[1,2,3]","[\"&A0\",1,2,3]","Multiple elements work"]
,["SEQ004","[1,2,3,]","","Trailing comma illegal"]
,["SEQ005","[,]","","Comma in empty list illegal"]
,["SEQ006","[\"&A99\"]","[\"&A0\"]","Custom anchors supported"]
,["SEQ007","[\"&Flue\"]","[\"&A0\"]","Anchors can have any letter form"]
,["SEQ008","[\"&A-B\"]","","Punctuated anchors illegal"]
,["SEQ009","[[1,2],[3,4]]","[\"&A0\",[\"&A1\",1,2],[\"&A2\",3,4]]","Nested arrays legal"]
,["ANC000","[[\"&A\",1,2],\"*A\"]","[\"&A0\",[\"&A1\",1,2],\"*A1\"]","Anchors may be used for substructure"]
,["ANC001","[[\"&A\",1,2],\"*A\",\"*A\"]","[\"&A0\",[\"&A1\",1,2],\"*A1\",\"*A1\"]","Anchors may be used for substructure more than once"]
,["ANC002","[\"*B\",[\"&B\",1,2]]","[\"&A0\",[\"&A1\",1,2],\"*A1\"]","Anchors may be used before definition"]
,["ANC003","[\"*Moo\"]","","Undefined anchors may not be used"]
,["ANC004","[\"&A\",\"*A\"]","[\"&A0\",\"*A0\"]","Arrays may be recursive"]
,["ANC005","[\"&A\",\"*a\"]","","Anchors are case sensitive"]
,["ANC006","{\"&\":\"A\",\"r\":\"*A\"}","{\"&\":\"A0\",\"r\":\"*A0\"}","Hashes may be recursive"]
,["ANC007","{\"r\":\"*A\",\"&\":\"A\"}","{\"&\":\"A0\",\"r\":\"*A0\"}","Hashes may be recursive even if anchor at end"]
,["MAP000","{}","{\"&\":\"A0\"}","Empty map is legal"]
,["MAP001","{\"a\",\"b\"}","",", cannot substitute for :"]
,["MAP002","{\"a\":1,\"b\":2}","{\"&\":\"A0\",\"a\":1,\"b\":2}","Non-empty maps legal"]
,["MAP003","{\"a\":\"b\",}","","Trailing commas in maps not legal"]
,["MAP004","{\"&\":\"Foo bar\"}","","Map anchors may not have spaces"]
]