Skip to content

Commit dc9b7c6

Browse files
committed
Add tests ensuring RFC3986 normalization.
1 parent 9153b05 commit dc9b7c6

12 files changed

+444
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"$schema": "../../test-schema.json",
3+
"registry": {
4+
"hTtP://example.com/case-insensitive-scheme": { "foo": "bar" },
5+
"http://exAmpLe.com/case-insensitive-host": { "baz": "quux" },
6+
"hTtP://exAmpLe.com/case-SENSITIVE-path": {},
7+
"http://example.com/escapes/a%c2%b1b": { "spam": "eggs" },
8+
"http://example.com/unreserved/%7Efoo": { "snap": "crackle" },
9+
"http://example.com:80/default/port": { "pop": 37 }
10+
},
11+
"tests": [
12+
{
13+
"ref": "http://example.com/case-insensitive-scheme",
14+
"target": { "foo": "bar" }
15+
},
16+
{
17+
"ref": "http://example.com/case-insensitive-host",
18+
"target": { "baz": "quux" }
19+
},
20+
{
21+
"ref": "http://example.com/case-sensitive-path",
22+
"error": true
23+
},
24+
{
25+
"ref": "http://example.com/escapes/a%C2%B1b",
26+
"target": { "spam": "eggs" }
27+
},
28+
{
29+
"ref": "http://example.com/unreserved/~foo",
30+
"target": { "snap": "crackle" }
31+
},
32+
{
33+
"ref": "http://example.com/default/port",
34+
"target": { "pop": 37 }
35+
}
36+
]
37+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"$schema": "../../test-schema.json",
3+
"registry": {
4+
"http://example.com/case-insensitive-scheme": { "foo": "bar" },
5+
"http://example.com/case-insensitive-host": { "baz": "quux" },
6+
"http://example.com/case-sensitive-path": {},
7+
"http://example.com/escapes/a%C2%B1b": { "spam": "eggs" },
8+
"http://example.com/unreserved/~foo": { "snap": "crackle" },
9+
"http://example.com/default/port": { "pop": 37 }
10+
},
11+
"tests": [
12+
{
13+
"ref": "hTtP://example.com/case-insensitive-scheme",
14+
"target": { "foo": "bar" }
15+
},
16+
{
17+
"ref": "http://exAmpLe.com/case-insensitive-host",
18+
"target": { "baz": "quux" }
19+
},
20+
{
21+
"ref": "hTtP://exAmpLe.com/case-SENSITIVE-path",
22+
"error": true
23+
},
24+
{
25+
"ref": "http://example.com/escapes/a%c2%b1b",
26+
"target": { "spam": "eggs" }
27+
},
28+
{
29+
"ref": "http://example.com/unreserved/%7Efoo",
30+
"target": { "snap": "crackle" }
31+
},
32+
{
33+
"ref": "http://example.com:80/default/port",
34+
"target": { "pop": 37 }
35+
}
36+
]
37+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"$schema": "../../test-schema.json",
3+
"registry": {
4+
"hTtP://example.com/case-insensitive-scheme": { "foo": "bar" },
5+
"http://exAmpLe.com/case-insensitive-host": { "baz": "quux" },
6+
"hTtP://exAmpLe.com/case-SENSITIVE-path": {},
7+
"http://example.com/escapes/a%c2%b1b": { "spam": "eggs" },
8+
"http://example.com/unreserved/%7Efoo": { "snap": "crackle" },
9+
"http://example.com:80/default/port": { "pop": 37 }
10+
},
11+
"tests": [
12+
{
13+
"ref": "http://example.com/case-insensitive-scheme",
14+
"target": { "foo": "bar" }
15+
},
16+
{
17+
"ref": "http://example.com/case-insensitive-host",
18+
"target": { "baz": "quux" }
19+
},
20+
{
21+
"ref": "http://example.com/case-sensitive-path",
22+
"error": true
23+
},
24+
{
25+
"ref": "http://example.com/escapes/a%C2%B1b",
26+
"target": { "spam": "eggs" }
27+
},
28+
{
29+
"ref": "http://example.com/unreserved/~foo",
30+
"target": { "snap": "crackle" }
31+
},
32+
{
33+
"ref": "http://example.com/default/port",
34+
"target": { "pop": 37 }
35+
}
36+
]
37+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"$schema": "../../test-schema.json",
3+
"registry": {
4+
"http://example.com/case-insensitive-scheme": { "foo": "bar" },
5+
"http://example.com/case-insensitive-host": { "baz": "quux" },
6+
"http://example.com/case-sensitive-path": {},
7+
"http://example.com/escapes/a%C2%B1b": { "spam": "eggs" },
8+
"http://example.com/unreserved/~foo": { "snap": "crackle" },
9+
"http://example.com/default/port": { "pop": 37 }
10+
},
11+
"tests": [
12+
{
13+
"ref": "hTtP://example.com/case-insensitive-scheme",
14+
"target": { "foo": "bar" }
15+
},
16+
{
17+
"ref": "http://exAmpLe.com/case-insensitive-host",
18+
"target": { "baz": "quux" }
19+
},
20+
{
21+
"ref": "hTtP://exAmpLe.com/case-SENSITIVE-path",
22+
"error": true
23+
},
24+
{
25+
"ref": "http://example.com/escapes/a%c2%b1b",
26+
"target": { "spam": "eggs" }
27+
},
28+
{
29+
"ref": "http://example.com/unreserved/%7Efoo",
30+
"target": { "snap": "crackle" }
31+
},
32+
{
33+
"ref": "http://example.com:80/default/port",
34+
"target": { "pop": 37 }
35+
}
36+
]
37+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"$schema": "../../test-schema.json",
3+
"registry": {
4+
"hTtP://example.com/case-insensitive-scheme": { "foo": "bar" },
5+
"http://exAmpLe.com/case-insensitive-host": { "baz": "quux" },
6+
"hTtP://exAmpLe.com/case-SENSITIVE-path": {},
7+
"http://example.com/escapes/a%c2%b1b": { "spam": "eggs" },
8+
"http://example.com/unreserved/%7Efoo": { "snap": "crackle" },
9+
"http://example.com:80/default/port": { "pop": 37 }
10+
},
11+
"tests": [
12+
{
13+
"ref": "http://example.com/case-insensitive-scheme",
14+
"target": { "foo": "bar" }
15+
},
16+
{
17+
"ref": "http://example.com/case-insensitive-host",
18+
"target": { "baz": "quux" }
19+
},
20+
{
21+
"ref": "http://example.com/case-sensitive-path",
22+
"error": true
23+
},
24+
{
25+
"ref": "http://example.com/escapes/a%C2%B1b",
26+
"target": { "spam": "eggs" }
27+
},
28+
{
29+
"ref": "http://example.com/unreserved/~foo",
30+
"target": { "snap": "crackle" }
31+
},
32+
{
33+
"ref": "http://example.com/default/port",
34+
"target": { "pop": 37 }
35+
}
36+
]
37+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"$schema": "../../test-schema.json",
3+
"registry": {
4+
"http://example.com/case-insensitive-scheme": { "foo": "bar" },
5+
"http://example.com/case-insensitive-host": { "baz": "quux" },
6+
"http://example.com/case-sensitive-path": {},
7+
"http://example.com/escapes/a%C2%B1b": { "spam": "eggs" },
8+
"http://example.com/unreserved/~foo": { "snap": "crackle" },
9+
"http://example.com/default/port": { "pop": 37 }
10+
},
11+
"tests": [
12+
{
13+
"ref": "hTtP://example.com/case-insensitive-scheme",
14+
"target": { "foo": "bar" }
15+
},
16+
{
17+
"ref": "http://exAmpLe.com/case-insensitive-host",
18+
"target": { "baz": "quux" }
19+
},
20+
{
21+
"ref": "hTtP://exAmpLe.com/case-SENSITIVE-path",
22+
"error": true
23+
},
24+
{
25+
"ref": "http://example.com/escapes/a%c2%b1b",
26+
"target": { "spam": "eggs" }
27+
},
28+
{
29+
"ref": "http://example.com/unreserved/%7Efoo",
30+
"target": { "snap": "crackle" }
31+
},
32+
{
33+
"ref": "http://example.com:80/default/port",
34+
"target": { "pop": 37 }
35+
}
36+
]
37+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"$schema": "../../test-schema.json",
3+
"registry": {
4+
"hTtP://example.com/case-insensitive-scheme": { "foo": "bar" },
5+
"http://exAmpLe.com/case-insensitive-host": { "baz": "quux" },
6+
"hTtP://exAmpLe.com/case-SENSITIVE-path": {},
7+
"http://example.com/escapes/a%c2%b1b": { "spam": "eggs" },
8+
"http://example.com/unreserved/%7Efoo": { "snap": "crackle" },
9+
"http://example.com:80/default/port": { "pop": 37 }
10+
},
11+
"tests": [
12+
{
13+
"ref": "http://example.com/case-insensitive-scheme",
14+
"target": { "foo": "bar" }
15+
},
16+
{
17+
"ref": "http://example.com/case-insensitive-host",
18+
"target": { "baz": "quux" }
19+
},
20+
{
21+
"ref": "http://example.com/case-sensitive-path",
22+
"error": true
23+
},
24+
{
25+
"ref": "http://example.com/escapes/a%C2%B1b",
26+
"target": { "spam": "eggs" }
27+
},
28+
{
29+
"ref": "http://example.com/unreserved/~foo",
30+
"target": { "snap": "crackle" }
31+
},
32+
{
33+
"ref": "http://example.com/default/port",
34+
"target": { "pop": 37 }
35+
}
36+
]
37+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"$schema": "../../test-schema.json",
3+
"registry": {
4+
"http://example.com/case-insensitive-scheme": { "foo": "bar" },
5+
"http://example.com/case-insensitive-host": { "baz": "quux" },
6+
"http://example.com/case-sensitive-path": {},
7+
"http://example.com/escapes/a%C2%B1b": { "spam": "eggs" },
8+
"http://example.com/unreserved/~foo": { "snap": "crackle" },
9+
"http://example.com/default/port": { "pop": 37 }
10+
},
11+
"tests": [
12+
{
13+
"ref": "hTtP://example.com/case-insensitive-scheme",
14+
"target": { "foo": "bar" }
15+
},
16+
{
17+
"ref": "http://exAmpLe.com/case-insensitive-host",
18+
"target": { "baz": "quux" }
19+
},
20+
{
21+
"ref": "hTtP://exAmpLe.com/case-SENSITIVE-path",
22+
"error": true
23+
},
24+
{
25+
"ref": "http://example.com/escapes/a%c2%b1b",
26+
"target": { "spam": "eggs" }
27+
},
28+
{
29+
"ref": "http://example.com/unreserved/%7Efoo",
30+
"target": { "snap": "crackle" }
31+
},
32+
{
33+
"ref": "http://example.com:80/default/port",
34+
"target": { "pop": 37 }
35+
}
36+
]
37+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"$schema": "../../test-schema.json",
3+
"registry": {
4+
"hTtP://example.com/case-insensitive-scheme": { "foo": "bar" },
5+
"http://exAmpLe.com/case-insensitive-host": { "baz": "quux" },
6+
"hTtP://exAmpLe.com/case-SENSITIVE-path": {},
7+
"http://example.com/escapes/a%c2%b1b": { "spam": "eggs" },
8+
"http://example.com/unreserved/%7Efoo": { "snap": "crackle" },
9+
"http://example.com:80/default/port": { "pop": 37 }
10+
},
11+
"tests": [
12+
{
13+
"ref": "http://example.com/case-insensitive-scheme",
14+
"target": { "foo": "bar" }
15+
},
16+
{
17+
"ref": "http://example.com/case-insensitive-host",
18+
"target": { "baz": "quux" }
19+
},
20+
{
21+
"ref": "http://example.com/case-sensitive-path",
22+
"error": true
23+
},
24+
{
25+
"ref": "http://example.com/escapes/a%C2%B1b",
26+
"target": { "spam": "eggs" }
27+
},
28+
{
29+
"ref": "http://example.com/unreserved/~foo",
30+
"target": { "snap": "crackle" }
31+
},
32+
{
33+
"ref": "http://example.com/default/port",
34+
"target": { "pop": 37 }
35+
}
36+
]
37+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"$schema": "../../test-schema.json",
3+
"registry": {
4+
"http://example.com/case-insensitive-scheme": { "foo": "bar" },
5+
"http://example.com/case-insensitive-host": { "baz": "quux" },
6+
"http://example.com/case-sensitive-path": {},
7+
"http://example.com/escapes/a%C2%B1b": { "spam": "eggs" },
8+
"http://example.com/unreserved/~foo": { "snap": "crackle" },
9+
"http://example.com/default/port": { "pop": 37 }
10+
},
11+
"tests": [
12+
{
13+
"ref": "hTtP://example.com/case-insensitive-scheme",
14+
"target": { "foo": "bar" }
15+
},
16+
{
17+
"ref": "http://exAmpLe.com/case-insensitive-host",
18+
"target": { "baz": "quux" }
19+
},
20+
{
21+
"ref": "hTtP://exAmpLe.com/case-SENSITIVE-path",
22+
"error": true
23+
},
24+
{
25+
"ref": "http://example.com/escapes/a%c2%b1b",
26+
"target": { "spam": "eggs" }
27+
},
28+
{
29+
"ref": "http://example.com/unreserved/%7Efoo",
30+
"target": { "snap": "crackle" }
31+
},
32+
{
33+
"ref": "http://example.com:80/default/port",
34+
"target": { "pop": 37 }
35+
}
36+
]
37+
}

0 commit comments

Comments
 (0)