-
Notifications
You must be signed in to change notification settings - Fork 21
/
param-list.json
108 lines (108 loc) · 3.54 KB
/
param-list.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
[
{
"name": "basic parameterised list",
"raw": ["abc_123;a=1;b=2; cdef_456, ghi;q=9;r=\"+w\""],
"header_type": "list",
"expected": [
[{"__type": "token", "value": "abc_123"}, [["a", 1], ["b", 2], ["cdef_456", true]]],
[{"__type": "token", "value": "ghi"}, [["q", 9], ["r", "+w"]]]
],
"canonical": ["abc_123;a=1;b=2;cdef_456, ghi;q=9;r=\"+w\""]
},
{
"name": "single item parameterised list",
"raw": ["text/html;q=1.0"],
"header_type": "list",
"expected": [
[{"__type": "token", "value": "text/html"}, [["q", 1.0]]]
]
},
{
"name": "missing parameter value parameterised list",
"raw": ["text/html;a;q=1.0"],
"header_type": "list",
"expected": [
[{"__type": "token", "value": "text/html"}, [["a", true], ["q", 1.0]]]
]
},
{
"name": "missing terminal parameter value parameterised list",
"raw": ["text/html;q=1.0;a"],
"header_type": "list",
"expected": [
[{"__type": "token", "value": "text/html"}, [["q", 1.0], ["a", true]]]
]
},
{
"name": "no whitespace parameterised list",
"raw": ["text/html,text/plain;q=0.5"],
"header_type": "list",
"expected": [
[{"__type": "token", "value": "text/html"}, []],
[{"__type": "token", "value": "text/plain"}, [["q", 0.5]]]
],
"canonical": ["text/html, text/plain;q=0.5"]
},
{
"name": "whitespace before = parameterised list",
"raw": ["text/html, text/plain;q =0.5"],
"header_type": "list",
"must_fail": true
},
{
"name": "whitespace after = parameterised list",
"raw": ["text/html, text/plain;q= 0.5"],
"header_type": "list",
"must_fail": true
},
{
"name": "whitespace before ; parameterised list",
"raw": ["text/html, text/plain ;q=0.5"],
"header_type": "list",
"must_fail": true
},
{
"name": "whitespace after ; parameterised list",
"raw": ["text/html, text/plain; q=0.5"],
"header_type": "list",
"expected": [
[{"__type": "token", "value": "text/html"}, []],
[{"__type": "token", "value": "text/plain"}, [["q", 0.5]]]
],
"canonical": ["text/html, text/plain;q=0.5"]
},
{
"name": "extra whitespace parameterised list",
"raw": ["text/html , text/plain; q=0.5; charset=utf-8"],
"header_type": "list",
"expected": [
[{"__type": "token", "value": "text/html"}, []],
[{"__type": "token", "value": "text/plain"},
[["q", 0.5], ["charset", {"__type": "token", "value": "utf-8"}
]]]
],
"canonical": ["text/html, text/plain;q=0.5;charset=utf-8"]
},
{
"name": "two lines parameterised list",
"raw": ["text/html", "text/plain;q=0.5"],
"header_type": "list",
"expected": [
[{"__type": "token", "value": "text/html"}, []],
[{"__type": "token", "value": "text/plain"}, [["q", 0.5]]]
],
"canonical": ["text/html, text/plain;q=0.5"]
},
{
"name": "trailing comma parameterised list",
"raw": ["text/html,text/plain;q=0.5,"],
"header_type": "list",
"must_fail": true
},
{
"name": "empty item parameterised list",
"raw": ["text/html,,text/plain;q=0.5,"],
"header_type": "list",
"must_fail": true
}
]