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