1[
2    {
3        "name": "basic parameterised dict",
4        "raw": ["abc=123;a=1;b=2, def=456, ghi=789;q=9;r=\"+w\""],
5        "header_type": "dictionary",
6        "expected": [
7            ["abc", [123, [["a", 1], ["b", 2]]]],
8            ["def", [456, []]],
9            ["ghi", [789, [["q", 9], ["r", "+w"]]]]
10        ]
11    },
12    {
13        "name": "single item parameterised dict",
14        "raw": ["a=b; q=1.0"],
15        "header_type": "dictionary",
16        "expected": [
17            ["a", [{"__type": "token", "value": "b"}, [["q", 1.0]]]]
18        ],
19        "canonical": ["a=b;q=1.0"]
20    },
21    {
22        "name": "list item parameterised dictionary",
23        "raw": ["a=(1 2); q=1.0"],
24        "header_type": "dictionary",
25        "expected": [["a", [[[1, []], [2, []]], [["q", 1.0]]]]],
26        "canonical": ["a=(1 2);q=1.0"]
27    },
28    {
29        "name": "missing parameter value parameterised dict",
30        "raw": ["a=3;c;d=5"],
31        "header_type": "dictionary",
32        "expected": [
33            ["a", [3, [["c", true], ["d", 5]]]]
34        ]
35    },
36    {
37        "name": "terminal missing parameter value parameterised dict",
38        "raw": ["a=3;c=5;d"],
39        "header_type": "dictionary",
40        "expected": [
41            ["a", [3, [["c", 5], ["d", true]]]]
42        ]
43    },
44    {
45        "name": "no whitespace parameterised dict",
46        "raw": ["a=b;c=1,d=e;f=2"],
47        "header_type": "dictionary",
48        "expected": [
49            ["a", [{"__type": "token", "value": "b"}, [["c", 1]]]],
50            ["d", [{"__type": "token", "value": "e"}, [["f", 2]]]]
51        ],
52        "canonical": ["a=b;c=1, d=e;f=2"]
53    },
54    {
55        "name": "whitespace before = parameterised dict",
56        "raw": ["a=b;q =0.5"],
57        "header_type": "dictionary",
58        "must_fail": true
59    },
60    {
61        "name": "whitespace after = parameterised dict",
62        "raw": ["a=b;q= 0.5"],
63        "header_type": "dictionary",
64        "must_fail": true
65    },
66    {
67        "name": "whitespace before ; parameterised dict",
68        "raw": ["a=b ;q=0.5"],
69        "header_type": "dictionary",
70        "must_fail": true
71    },
72    {
73        "name": "whitespace after ; parameterised dict",
74        "raw": ["a=b; q=0.5"],
75        "header_type": "dictionary",
76        "expected": [
77            ["a", [{"__type": "token", "value": "b"}, [["q", 0.5]]]]
78        ],
79        "canonical": ["a=b;q=0.5"]
80    },
81    {
82        "name": "extra whitespace parameterised dict",
83        "raw": ["a=b;  c=1  ,  d=e; f=2; g=3"],
84        "header_type": "dictionary",
85        "expected": [
86            ["a", [{"__type": "token", "value": "b"}, [["c", 1]]]],
87            ["d", [{"__type": "token", "value": "e"}, [["f", 2], ["g", 3]]]]
88        ],
89        "canonical": ["a=b;c=1, d=e;f=2;g=3"]
90    },
91    {
92        "name": "two lines parameterised list",
93        "raw": ["a=b;c=1", "d=e;f=2"],
94        "header_type": "dictionary",
95        "expected": [
96            ["a", [{"__type": "token", "value": "b"}, [["c", 1]]]],
97            ["d", [{"__type": "token", "value": "e"}, [["f", 2]]]]
98        ],
99        "canonical": ["a=b;c=1, d=e;f=2"]
100    },
101    {
102        "name": "trailing comma parameterised list",
103        "raw": ["a=b; q=1.0,"],
104        "header_type": "dictionary",
105        "must_fail": true
106    },
107    {
108        "name": "empty item parameterised list",
109        "raw": ["a=b; q=1.0,,c=d"],
110        "header_type": "dictionary",
111        "must_fail": true
112    }
113]
114