-
Notifications
You must be signed in to change notification settings - Fork 21
/
dictionary.json
163 lines (163 loc) · 4.61 KB
/
dictionary.json
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
[
{
"name": "basic dictionary",
"raw": ["en=\"Applepie\", da=:w4ZibGV0w6ZydGUK:"],
"header_type": "dictionary",
"expected": [["en", ["Applepie", []]], ["da", [
{"__type": "binary", "value": "YODGE3DFOTB2M4TUMUFA===="},
[]]
]]
},
{
"name": "empty dictionary",
"raw": [""],
"header_type": "dictionary",
"expected": [],
"canonical": []
},
{
"name": "single item dictionary",
"raw": ["a=1"],
"header_type": "dictionary",
"expected": [["a", [1, []]]]
},
{
"name": "list item dictionary",
"raw": ["a=(1 2)"],
"header_type": "dictionary",
"expected": [["a", [[[1, []], [2, []]], []]]]
},
{
"name": "single list item dictionary",
"raw": ["a=(1)"],
"header_type": "dictionary",
"expected": [["a", [[[1, []]], []]]]
},
{
"name": "empty list item dictionary",
"raw": ["a=()"],
"header_type": "dictionary",
"expected": [["a", [[], []]]]
},
{
"name": "no whitespace dictionary",
"raw": ["a=1,b=2"],
"header_type": "dictionary",
"expected": [["a", [1, []]], ["b", [2, []]]],
"canonical": ["a=1, b=2"]
},
{
"name": "extra whitespace dictionary",
"raw": ["a=1 , b=2"],
"header_type": "dictionary",
"expected": [["a", [1, []]], ["b", [2, []]]],
"canonical": ["a=1, b=2"]
},
{
"name": "tab separated dictionary",
"raw": ["a=1\t,\tb=2"],
"header_type": "dictionary",
"expected": [["a", [1, []]], ["b", [2, []]]],
"canonical": ["a=1, b=2"]
},
{
"name": "leading whitespace dictionary",
"raw": [" a=1 , b=2"],
"header_type": "dictionary",
"expected": [["a", [1, []]], ["b", [2, []]]],
"canonical": ["a=1, b=2"]
},
{
"name": "whitespace before = dictionary",
"raw": ["a =1, b=2"],
"header_type": "dictionary",
"must_fail": true
},
{
"name": "whitespace after = dictionary",
"raw": ["a=1, b= 2"],
"header_type": "dictionary",
"must_fail": true
},
{
"name": "two lines dictionary",
"raw": ["a=1", "b=2"],
"header_type": "dictionary",
"expected": [["a", [1, []]], ["b", [2, []]]],
"canonical": ["a=1, b=2"]
},
{
"name": "missing value dictionary",
"raw": ["a=1, b, c=3"],
"header_type": "dictionary",
"expected": [["a", [1, []]], ["b", [true, []]], ["c", [3, []]]]
},
{
"name": "all missing value dictionary",
"raw": ["a, b, c"],
"header_type": "dictionary",
"expected": [["a", [true, []]], ["b", [true, []]], ["c", [true, []]]]
},
{
"name": "start missing value dictionary",
"raw": ["a, b=2"],
"header_type": "dictionary",
"expected": [["a", [true, []]], ["b", [2, []]]]
},
{
"name": "end missing value dictionary",
"raw": ["a=1, b"],
"header_type": "dictionary",
"expected": [["a", [1, []]], ["b", [true, []]]]
},
{
"name": "missing value with params dictionary",
"raw": ["a=1, b;foo=9, c=3"],
"header_type": "dictionary",
"expected": [["a", [1, []]], ["b", [true, [["foo", 9]]]], ["c", [3, []]]]
},
{
"name": "explicit true value with params dictionary",
"raw": ["a=1, b=?1;foo=9, c=3"],
"header_type": "dictionary",
"expected": [["a", [1, []]], ["b", [true, [["foo", 9]]]], ["c", [3, []]]],
"canonical": ["a=1, b;foo=9, c=3"]
},
{
"name": "trailing comma dictionary",
"raw": ["a=1, b=2,"],
"header_type": "dictionary",
"must_fail": true
},
{
"name": "empty item dictionary",
"raw": ["a=1,,b=2,"],
"header_type": "dictionary",
"must_fail": true
},
{
"name": "duplicate key dictionary",
"raw": ["a=1,b=2,a=3"],
"header_type": "dictionary",
"expected": [["a", [3, []]], ["b", [2, []]]],
"canonical": ["a=3, b=2"]
},
{
"name": "numeric key dictionary",
"raw": ["a=1,1b=2,a=1"],
"header_type": "dictionary",
"must_fail": true
},
{
"name": "uppercase key dictionary",
"raw": ["a=1,B=2,a=1"],
"header_type": "dictionary",
"must_fail": true
},
{
"name": "bad key dictionary",
"raw": ["a=1,b!=2,a=1"],
"header_type": "dictionary",
"must_fail": true
}
]