Skip to content

Commit 4bae8aa

Browse files
committed
Add more idn-hostname tests to draft-2019-09 and draft-07
1 parent 6d91158 commit 4bae8aa

File tree

2 files changed

+121
-1
lines changed

2 files changed

+121
-1
lines changed

tests/draft2019-09/optional/format/idn-hostname.json

+61-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
33
"description": "validation of internationalized host names",
4-
"schema": {"format": "idn-hostname"},
4+
"schema": { "format": "idn-hostname" },
55
"tests": [
66
{
77
"description": "a valid host name (example.test in Hangul)",
@@ -22,6 +22,66 @@
2222
"description": "a host name with a component too long",
2323
"data": "실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실례례테스트례례례례례례례례례례례례례례례례례테스트례례례례례례례례례례례례례례례례례례례테스트례례례례례례례례례례례례테스트례례실례.테스트",
2424
"valid": false
25+
},
26+
{
27+
"description": "invalid label, correct Punycode",
28+
"comment": "https://tools.ietf.org/html/rfc5890#section-2.3.2.1 https://tools.ietf.org/html/rfc5891#section-4.4 https://tools.ietf.org/html/rfc3492#section-7.1",
29+
"data": "-> $1.00 <--",
30+
"valid": false
31+
},
32+
{
33+
"description": "valid Chinese Punycode",
34+
"comment": "https://tools.ietf.org/html/rfc5890#section-2.3.2.1 https://tools.ietf.org/html/rfc5891#section-4.4",
35+
"data": "xn--ihqwcrb4cv8a8dqg056pqjye",
36+
"valid": true
37+
},
38+
{
39+
"description": "invalid Punycode",
40+
"comment": "https://tools.ietf.org/html/rfc5891#section-4.4 https://tools.ietf.org/html/rfc5890#section-2.3.2.1",
41+
"data": "xn--X",
42+
"valid": false
43+
},
44+
{
45+
"description": "U-label contains \"--\" in the 3rd and 4th position",
46+
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.1 https://tools.ietf.org/html/rfc5890#section-2.3.2.1",
47+
"data": "XN--aa---o47jg78q",
48+
"valid": false
49+
},
50+
{
51+
"description": "U-label starts with a dash",
52+
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.1",
53+
"data": "-hello",
54+
"valid": false
55+
},
56+
{
57+
"description": "U-label ends with a dash",
58+
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.1",
59+
"data": "hello-",
60+
"valid": false
61+
},
62+
{
63+
"description": "U-label starts and ends with a dash",
64+
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.1",
65+
"data": "-hello-",
66+
"valid": false
67+
},
68+
{
69+
"description": "Begins with a Spacing Combining Mark",
70+
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.2",
71+
"data": "\u0903hello",
72+
"valid": false
73+
},
74+
{
75+
"description": "Begins with a Nonspacing Mark",
76+
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.2",
77+
"data": "\u0300hello",
78+
"valid": false
79+
},
80+
{
81+
"description": "Begins with an Enclosing Mark",
82+
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.2",
83+
"data": "\u0488hello",
84+
"valid": false
2585
}
2686
]
2787
}

tests/draft7/optional/format/idn-hostname.json

+60
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,66 @@
2222
"description": "a host name with a component too long",
2323
"data": "실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실례례테스트례례례례례례례례례례례례례례례례례테스트례례례례례례례례례례례례례례례례례례례테스트례례례례례례례례례례례례테스트례례실례.테스트",
2424
"valid": false
25+
},
26+
{
27+
"description": "invalid label, correct Punycode",
28+
"comment": "https://tools.ietf.org/html/rfc5890#section-2.3.2.1 https://tools.ietf.org/html/rfc5891#section-4.4 https://tools.ietf.org/html/rfc3492#section-7.1",
29+
"data": "-> $1.00 <--",
30+
"valid": false
31+
},
32+
{
33+
"description": "valid Chinese Punycode",
34+
"comment": "https://tools.ietf.org/html/rfc5890#section-2.3.2.1 https://tools.ietf.org/html/rfc5891#section-4.4",
35+
"data": "xn--ihqwcrb4cv8a8dqg056pqjye",
36+
"valid": true
37+
},
38+
{
39+
"description": "invalid Punycode",
40+
"comment": "https://tools.ietf.org/html/rfc5891#section-4.4 https://tools.ietf.org/html/rfc5890#section-2.3.2.1",
41+
"data": "xn--X",
42+
"valid": false
43+
},
44+
{
45+
"description": "U-label contains \"--\" in the 3rd and 4th position",
46+
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.1 https://tools.ietf.org/html/rfc5890#section-2.3.2.1",
47+
"data": "XN--aa---o47jg78q",
48+
"valid": false
49+
},
50+
{
51+
"description": "U-label starts with a dash",
52+
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.1",
53+
"data": "-hello",
54+
"valid": false
55+
},
56+
{
57+
"description": "U-label ends with a dash",
58+
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.1",
59+
"data": "hello-",
60+
"valid": false
61+
},
62+
{
63+
"description": "U-label starts and ends with a dash",
64+
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.1",
65+
"data": "-hello-",
66+
"valid": false
67+
},
68+
{
69+
"description": "Begins with a Spacing Combining Mark",
70+
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.2",
71+
"data": "\u0903hello",
72+
"valid": false
73+
},
74+
{
75+
"description": "Begins with a Nonspacing Mark",
76+
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.2",
77+
"data": "\u0300hello",
78+
"valid": false
79+
},
80+
{
81+
"description": "Begins with an Enclosing Mark",
82+
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.2",
83+
"data": "\u0488hello",
84+
"valid": false
2585
}
2686
]
2787
}

0 commit comments

Comments
 (0)