1[
2    {
3        "name": "basic dictionary",
4        "raw": ["en=\"Applepie\", da=:w4ZibGV0w6ZydGUK:"],
5        "header_type": "dictionary",
6        "expected": [["en", ["Applepie", []]], ["da", [
7            {"__type": "binary", "value": "YODGE3DFOTB2M4TUMUFA===="},
8            []]
9        ]]
10    },
11    {
12        "name": "empty dictionary",
13        "raw": [""],
14        "header_type": "dictionary",
15        "expected": [],
16        "canonical": []
17    },
18    {
19        "name": "single item dictionary",
20        "raw": ["a=1"],
21        "header_type": "dictionary",
22        "expected": [["a", [1, []]]]
23    },
24    {
25        "name": "list item dictionary",
26        "raw": ["a=(1 2)"],
27        "header_type": "dictionary",
28        "expected": [["a", [[[1, []], [2, []]], []]]]
29    },
30    {
31        "name": "single list item dictionary",
32        "raw": ["a=(1)"],
33        "header_type": "dictionary",
34        "expected": [["a", [[[1, []]], []]]]
35    },
36    {
37        "name": "empty list item dictionary",
38        "raw": ["a=()"],
39        "header_type": "dictionary",
40        "expected": [["a", [[], []]]]
41    },
42    {
43        "name": "no whitespace dictionary",
44        "raw": ["a=1,b=2"],
45        "header_type": "dictionary",
46        "expected": [["a", [1, []]], ["b", [2, []]]],
47        "canonical": ["a=1, b=2"]
48    },
49    {
50        "name": "extra whitespace dictionary",
51        "raw": ["a=1 ,  b=2"],
52        "header_type": "dictionary",
53        "expected": [["a", [1, []]], ["b", [2, []]]],
54        "canonical": ["a=1, b=2"]
55    },
56    {
57        "name": "tab separated dictionary",
58        "raw": ["a=1\t,\tb=2"],
59        "header_type": "dictionary",
60        "expected": [["a", [1, []]], ["b", [2, []]]],
61        "canonical": ["a=1, b=2"]
62    },
63    {
64        "name": "leading whitespace dictionary",
65        "raw": ["     a=1 ,  b=2"],
66        "header_type": "dictionary",
67        "expected": [["a", [1, []]], ["b", [2, []]]],
68        "canonical": ["a=1, b=2"]
69    },
70    {
71        "name": "whitespace before = dictionary",
72        "raw": ["a =1, b=2"],
73        "header_type": "dictionary",
74        "must_fail": true
75    },
76    {
77        "name": "whitespace after = dictionary",
78        "raw": ["a=1, b= 2"],
79        "header_type": "dictionary",
80        "must_fail": true
81    },
82    {
83        "name": "two lines dictionary",
84        "raw": ["a=1", "b=2"],
85        "header_type": "dictionary",
86        "expected": [["a", [1, []]], ["b", [2, []]]],
87        "canonical": ["a=1, b=2"]
88    },
89    {
90        "name": "missing value dictionary",
91        "raw": ["a=1, b, c=3"],
92        "header_type": "dictionary",
93        "expected": [["a", [1, []]], ["b", [true, []]], ["c", [3, []]]]
94    },
95    {
96        "name": "all missing value dictionary",
97        "raw": ["a, b, c"],
98        "header_type": "dictionary",
99        "expected": [["a", [true, []]], ["b", [true, []]], ["c", [true, []]]]
100    },
101    {
102        "name": "start missing value dictionary",
103        "raw": ["a, b=2"],
104        "header_type": "dictionary",
105        "expected": [["a", [true, []]], ["b", [2, []]]]
106    },
107    {
108        "name": "end missing value dictionary",
109        "raw": ["a=1, b"],
110        "header_type": "dictionary",
111        "expected": [["a", [1, []]], ["b", [true, []]]]
112    },
113    {
114        "name": "missing value with params dictionary",
115        "raw": ["a=1, b;foo=9, c=3"],
116        "header_type": "dictionary",
117        "expected": [["a", [1, []]], ["b", [true, [["foo", 9]]]], ["c", [3, []]]]
118    },
119    {
120        "name": "explicit true value with params dictionary",
121        "raw": ["a=1, b=?1;foo=9, c=3"],
122        "header_type": "dictionary",
123        "expected": [["a", [1, []]], ["b", [true, [["foo", 9]]]], ["c", [3, []]]],
124        "canonical": ["a=1, b;foo=9, c=3"]
125    },
126    {
127        "name": "trailing comma dictionary",
128        "raw": ["a=1, b=2,"],
129        "header_type": "dictionary",
130        "must_fail": true
131    },
132    {
133        "name": "empty item dictionary",
134        "raw": ["a=1,,b=2,"],
135        "header_type": "dictionary",
136        "must_fail": true
137    },
138    {
139        "name": "duplicate key dictionary",
140        "raw": ["a=1,b=2,a=3"],
141        "header_type": "dictionary",
142        "expected": [["a", [3, []]], ["b", [2, []]]],
143        "canonical": ["a=3, b=2"]
144    },
145    {
146        "name": "numeric key dictionary",
147        "raw": ["a=1,1b=2,a=1"],
148        "header_type": "dictionary",
149        "must_fail": true
150    },
151    {
152        "name": "uppercase key dictionary",
153        "raw": ["a=1,B=2,a=1"],
154        "header_type": "dictionary",
155        "must_fail": true
156    },
157    {
158        "name": "bad key dictionary",
159        "raw": ["a=1,b!=2,a=1"],
160        "header_type": "dictionary",
161        "must_fail": true
162    }
163]
164