Skip to content

Commit 2af3a1f

Browse files
committed
Test label separator position in hostname formats
These are mostly meant to test that the additional `idn-hostname` label separators are treated like `.` and are only allowed between labels.
1 parent 48461fc commit 2af3a1f

File tree

10 files changed

+220
-0
lines changed

10 files changed

+220
-0
lines changed

tests/draft-next/optional/format/hostname.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,16 @@
130130
"description": "single dot",
131131
"data": ".",
132132
"valid": false
133+
},
134+
{
135+
"description": "leading dot",
136+
"data": ".example",
137+
"valid": false
138+
},
139+
{
140+
"description": "trailing dot",
141+
"data": "example.",
142+
"valid": false
133143
}
134144
]
135145
}

tests/draft-next/optional/format/idn-hostname.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,46 @@
383383
"description": "halfwidth ideographic full stop as label separator",
384384
"data": "a\uff61b",
385385
"valid": true
386+
},
387+
{
388+
"description": "leading dot",
389+
"data": ".example",
390+
"valid": false
391+
},
392+
{
393+
"description": "leading ideographic full stop",
394+
"data": "\u3002example",
395+
"valid": false
396+
},
397+
{
398+
"description": "leading fullwidth full stop",
399+
"data": "\uff0eexample",
400+
"valid": false
401+
},
402+
{
403+
"description": "leading halfwidth ideographic full stop",
404+
"data": "\uff61example",
405+
"valid": false
406+
},
407+
{
408+
"description": "trailing dot",
409+
"data": "example.",
410+
"valid": false
411+
},
412+
{
413+
"description": "trailing ideographic full stop",
414+
"data": "example\u3002",
415+
"valid": false
416+
},
417+
{
418+
"description": "trailing fullwidth full stop",
419+
"data": "example\uff0e",
420+
"valid": false
421+
},
422+
{
423+
"description": "trailing halfwidth ideographic full stop",
424+
"data": "example\uff61",
425+
"valid": false
386426
}
387427
]
388428
}

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,16 @@
130130
"description": "single dot",
131131
"data": ".",
132132
"valid": false
133+
},
134+
{
135+
"description": "leading dot",
136+
"data": ".example",
137+
"valid": false
138+
},
139+
{
140+
"description": "trailing dot",
141+
"data": "example.",
142+
"valid": false
133143
}
134144
]
135145
}

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

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,46 @@
383383
"description": "halfwidth ideographic full stop as label separator",
384384
"data": "a\uff61b",
385385
"valid": true
386+
},
387+
{
388+
"description": "leading dot",
389+
"data": ".example",
390+
"valid": false
391+
},
392+
{
393+
"description": "leading ideographic full stop",
394+
"data": "\u3002example",
395+
"valid": false
396+
},
397+
{
398+
"description": "leading fullwidth full stop",
399+
"data": "\uff0eexample",
400+
"valid": false
401+
},
402+
{
403+
"description": "leading halfwidth ideographic full stop",
404+
"data": "\uff61example",
405+
"valid": false
406+
},
407+
{
408+
"description": "trailing dot",
409+
"data": "example.",
410+
"valid": false
411+
},
412+
{
413+
"description": "trailing ideographic full stop",
414+
"data": "example\u3002",
415+
"valid": false
416+
},
417+
{
418+
"description": "trailing fullwidth full stop",
419+
"data": "example\uff0e",
420+
"valid": false
421+
},
422+
{
423+
"description": "trailing halfwidth ideographic full stop",
424+
"data": "example\uff61",
425+
"valid": false
386426
}
387427
]
388428
}

tests/draft2020-12/optional/format/hostname.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,16 @@
130130
"description": "single dot",
131131
"data": ".",
132132
"valid": false
133+
},
134+
{
135+
"description": "leading dot",
136+
"data": ".example",
137+
"valid": false
138+
},
139+
{
140+
"description": "trailing dot",
141+
"data": "example.",
142+
"valid": false
133143
}
134144
]
135145
}

tests/draft2020-12/optional/format/idn-hostname.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,46 @@
383383
"description": "halfwidth ideographic full stop as label separator",
384384
"data": "a\uff61b",
385385
"valid": true
386+
},
387+
{
388+
"description": "leading dot",
389+
"data": ".example",
390+
"valid": false
391+
},
392+
{
393+
"description": "leading ideographic full stop",
394+
"data": "\u3002example",
395+
"valid": false
396+
},
397+
{
398+
"description": "leading fullwidth full stop",
399+
"data": "\uff0eexample",
400+
"valid": false
401+
},
402+
{
403+
"description": "leading halfwidth ideographic full stop",
404+
"data": "\uff61example",
405+
"valid": false
406+
},
407+
{
408+
"description": "trailing dot",
409+
"data": "example.",
410+
"valid": false
411+
},
412+
{
413+
"description": "trailing ideographic full stop",
414+
"data": "example\u3002",
415+
"valid": false
416+
},
417+
{
418+
"description": "trailing fullwidth full stop",
419+
"data": "example\uff0e",
420+
"valid": false
421+
},
422+
{
423+
"description": "trailing halfwidth ideographic full stop",
424+
"data": "example\uff61",
425+
"valid": false
386426
}
387427
]
388428
}

tests/draft4/optional/format/hostname.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,16 @@
122122
"description": "single dot",
123123
"data": ".",
124124
"valid": false
125+
},
126+
{
127+
"description": "leading dot",
128+
"data": ".example",
129+
"valid": false
130+
},
131+
{
132+
"description": "trailing dot",
133+
"data": "example.",
134+
"valid": false
125135
}
126136
]
127137
}

tests/draft6/optional/format/hostname.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,16 @@
122122
"description": "single dot",
123123
"data": ".",
124124
"valid": false
125+
},
126+
{
127+
"description": "leading dot",
128+
"data": ".example",
129+
"valid": false
130+
},
131+
{
132+
"description": "trailing dot",
133+
"data": "example.",
134+
"valid": false
125135
}
126136
]
127137
}

tests/draft7/optional/format/hostname.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,16 @@
122122
"description": "single dot",
123123
"data": ".",
124124
"valid": false
125+
},
126+
{
127+
"description": "leading dot",
128+
"data": ".example",
129+
"valid": false
130+
},
131+
{
132+
"description": "trailing dot",
133+
"data": "example.",
134+
"valid": false
125135
}
126136
]
127137
}

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

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,46 @@
372372
"description": "halfwidth ideographic full stop as label separator",
373373
"data": "a\uff61b",
374374
"valid": true
375+
},
376+
{
377+
"description": "leading dot",
378+
"data": ".example",
379+
"valid": false
380+
},
381+
{
382+
"description": "leading ideographic full stop",
383+
"data": "\u3002example",
384+
"valid": false
385+
},
386+
{
387+
"description": "leading fullwidth full stop",
388+
"data": "\uff0eexample",
389+
"valid": false
390+
},
391+
{
392+
"description": "leading halfwidth ideographic full stop",
393+
"data": "\uff61example",
394+
"valid": false
395+
},
396+
{
397+
"description": "trailing dot",
398+
"data": "example.",
399+
"valid": false
400+
},
401+
{
402+
"description": "trailing ideographic full stop",
403+
"data": "example\u3002",
404+
"valid": false
405+
},
406+
{
407+
"description": "trailing fullwidth full stop",
408+
"data": "example\uff0e",
409+
"valid": false
410+
},
411+
{
412+
"description": "trailing halfwidth ideographic full stop",
413+
"data": "example\uff61",
414+
"valid": false
375415
}
376416
]
377417
}

0 commit comments

Comments
 (0)