Skip to content

Commit 4fa572d

Browse files
author
Oleg
committed
Move tests for rfc3490#3.1 into a separate test case
1 parent ce9f68c commit 4fa572d

File tree

4 files changed

+93
-40
lines changed

4 files changed

+93
-40
lines changed

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

+24-10
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
[
22
{
33
"description": "validation of internationalized host names",
4-
"specification": [
5-
{"rfc3490": "3.1", "quote": "Whenever dots are used as label separators, the following characters MUST be recognized as dots: U+002E (full stop), U+3002 (ideographic full stop), U+FF0E (fullwidth full stop), U+FF61(halfwidth ideographic full stop)"}
6-
],
74
"schema": {
85
"$schema": "https://json-schema.org/draft/next/schema",
96
"format": "idn-hostname"
@@ -334,39 +331,56 @@
334331
"description": "empty string",
335332
"data": "",
336333
"valid": false
337-
},
334+
}
335+
]
336+
},
337+
{
338+
"description": "validation of separators in internationalized host names",
339+
"specification": [
340+
{"rfc3490": "3.1", "quote": "Whenever dots are used as label separators, the following characters MUST be recognized as dots: U+002E (full stop), U+3002 (ideographic full stop), U+FF0E (fullwidth full stop), U+FF61(halfwidth ideographic full stop)"}
341+
],
342+
"schema": {
343+
"$schema": "https://json-schema.org/draft/next/schema",
344+
"format": "idn-hostname"
345+
},
346+
"tests": [
338347
{
339348
"description": "single dot",
340349
"data": ".",
341350
"valid": false
342351
},
343352
{
344-
"description": "single ideographic full stop (RFC 3490#3.1)",
353+
"description": "single ideographic full stop",
345354
"data": "\u3002",
346355
"valid": false
347356
},
348357
{
349-
"description": "single fullwidth full stop (RFC 3490#3.1)",
358+
"description": "single fullwidth full stop",
350359
"data": "\uff0e",
351360
"valid": false
352361
},
353362
{
354-
"description": "single halfwidth ideographic full stop (RFC 3490#3.1)",
363+
"description": "single halfwidth ideographic full stop",
355364
"data": "\uff61",
356365
"valid": false
357366
},
358367
{
359-
"description": "ideographic full stop (RFC 3490#3.1) as label separator",
368+
"description": "dot as label separator",
369+
"data": "a.b",
370+
"valid": true
371+
},
372+
{
373+
"description": "ideographic full stop as label separator",
360374
"data": "a\u3002b",
361375
"valid": true
362376
},
363377
{
364-
"description": "fullwidth full stop (RFC 3490#3.1) as label separator",
378+
"description": "fullwidth full stop as label separator",
365379
"data": "a\uff0eb",
366380
"valid": true
367381
},
368382
{
369-
"description": "halfwidth ideographic full stop (RFC 3490#3.1) as label separator",
383+
"description": "halfwidth ideographic full stop as label separator",
370384
"data": "a\uff61b",
371385
"valid": true
372386
}

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

+24-10
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
[
22
{
33
"description": "validation of internationalized host names",
4-
"specification": [
5-
{"rfc3490": "3.1", "quote": "Whenever dots are used as label separators, the following characters MUST be recognized as dots: U+002E (full stop), U+3002 (ideographic full stop), U+FF0E (fullwidth full stop), U+FF61(halfwidth ideographic full stop)"}
6-
],
74
"schema": {
85
"$schema": "https://json-schema.org/draft/2019-09/schema",
96
"format": "idn-hostname"
@@ -334,39 +331,56 @@
334331
"description": "empty string",
335332
"data": "",
336333
"valid": false
337-
},
334+
}
335+
]
336+
},
337+
{
338+
"description": "validation of separators in internationalized host names",
339+
"specification": [
340+
{"rfc3490": "3.1", "quote": "Whenever dots are used as label separators, the following characters MUST be recognized as dots: U+002E (full stop), U+3002 (ideographic full stop), U+FF0E (fullwidth full stop), U+FF61(halfwidth ideographic full stop)"}
341+
],
342+
"schema": {
343+
"$schema": "https://json-schema.org/draft/2019-09/schema",
344+
"format": "idn-hostname"
345+
},
346+
"tests": [
338347
{
339348
"description": "single dot",
340349
"data": ".",
341350
"valid": false
342351
},
343352
{
344-
"description": "single ideographic full stop (RFC 3490#3.1)",
353+
"description": "single ideographic full stop",
345354
"data": "\u3002",
346355
"valid": false
347356
},
348357
{
349-
"description": "single fullwidth full stop (RFC 3490#3.1)",
358+
"description": "single fullwidth full stop",
350359
"data": "\uff0e",
351360
"valid": false
352361
},
353362
{
354-
"description": "single halfwidth ideographic full stop (RFC 3490#3.1)",
363+
"description": "single halfwidth ideographic full stop",
355364
"data": "\uff61",
356365
"valid": false
357366
},
358367
{
359-
"description": "ideographic full stop (RFC 3490#3.1) as label separator",
368+
"description": "dot as label separator",
369+
"data": "a.b",
370+
"valid": true
371+
},
372+
{
373+
"description": "ideographic full stop as label separator",
360374
"data": "a\u3002b",
361375
"valid": true
362376
},
363377
{
364-
"description": "fullwidth full stop (RFC 3490#3.1) as label separator",
378+
"description": "fullwidth full stop as label separator",
365379
"data": "a\uff0eb",
366380
"valid": true
367381
},
368382
{
369-
"description": "halfwidth ideographic full stop (RFC 3490#3.1) as label separator",
383+
"description": "halfwidth ideographic full stop as label separator",
370384
"data": "a\uff61b",
371385
"valid": true
372386
}

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

+24-10
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
[
22
{
33
"description": "validation of internationalized host names",
4-
"specification": [
5-
{"rfc3490": "3.1", "quote": "Whenever dots are used as label separators, the following characters MUST be recognized as dots: U+002E (full stop), U+3002 (ideographic full stop), U+FF0E (fullwidth full stop), U+FF61(halfwidth ideographic full stop)"}
6-
],
74
"schema": {
85
"$schema": "https://json-schema.org/draft/2020-12/schema",
96
"format": "idn-hostname"
@@ -334,39 +331,56 @@
334331
"description": "empty string",
335332
"data": "",
336333
"valid": false
337-
},
334+
}
335+
]
336+
},
337+
{
338+
"description": "validation of separators in internationalized host names",
339+
"specification": [
340+
{"rfc3490": "3.1", "quote": "Whenever dots are used as label separators, the following characters MUST be recognized as dots: U+002E (full stop), U+3002 (ideographic full stop), U+FF0E (fullwidth full stop), U+FF61(halfwidth ideographic full stop)"}
341+
],
342+
"schema": {
343+
"$schema": "https://json-schema.org/draft/2020-12/schema",
344+
"format": "idn-hostname"
345+
},
346+
"tests": [
338347
{
339348
"description": "single dot",
340349
"data": ".",
341350
"valid": false
342351
},
343352
{
344-
"description": "single ideographic full stop (RFC 3490#3.1)",
353+
"description": "single ideographic full stop",
345354
"data": "\u3002",
346355
"valid": false
347356
},
348357
{
349-
"description": "single fullwidth full stop (RFC 3490#3.1)",
358+
"description": "single fullwidth full stop",
350359
"data": "\uff0e",
351360
"valid": false
352361
},
353362
{
354-
"description": "single halfwidth ideographic full stop (RFC 3490#3.1)",
363+
"description": "single halfwidth ideographic full stop",
355364
"data": "\uff61",
356365
"valid": false
357366
},
358367
{
359-
"description": "ideographic full stop (RFC 3490#3.1) as label separator",
368+
"description": "dot as label separator",
369+
"data": "a.b",
370+
"valid": true
371+
},
372+
{
373+
"description": "ideographic full stop as label separator",
360374
"data": "a\u3002b",
361375
"valid": true
362376
},
363377
{
364-
"description": "fullwidth full stop (RFC 3490#3.1) as label separator",
378+
"description": "fullwidth full stop as label separator",
365379
"data": "a\uff0eb",
366380
"valid": true
367381
},
368382
{
369-
"description": "halfwidth ideographic full stop (RFC 3490#3.1) as label separator",
383+
"description": "halfwidth ideographic full stop as label separator",
370384
"data": "a\uff61b",
371385
"valid": true
372386
}

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

+21-10
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
[
22
{
33
"description": "validation of internationalized host names",
4-
"specification": [
5-
{"rfc3490": "3.1", "quote": "Whenever dots are used as label separators, the following characters MUST be recognized as dots: U+002E (full stop), U+3002 (ideographic full stop), U+FF0E (fullwidth full stop), U+FF61(halfwidth ideographic full stop)"}
6-
],
74
"schema": { "format": "idn-hostname" },
85
"tests": [
96
{
@@ -326,39 +323,53 @@
326323
"description": "empty string",
327324
"data": "",
328325
"valid": false
329-
},
326+
}
327+
]
328+
},
329+
{
330+
"description": "validation of separators in internationalized host names",
331+
"specification": [
332+
{"rfc3490": "3.1", "quote": "Whenever dots are used as label separators, the following characters MUST be recognized as dots: U+002E (full stop), U+3002 (ideographic full stop), U+FF0E (fullwidth full stop), U+FF61(halfwidth ideographic full stop)"}
333+
],
334+
"schema": { "format": "idn-hostname" },
335+
"tests": [
330336
{
331337
"description": "single dot",
332338
"data": ".",
333339
"valid": false
334340
},
335341
{
336-
"description": "single ideographic full stop (RFC 3490#3.1)",
342+
"description": "single ideographic full stop",
337343
"data": "\u3002",
338344
"valid": false
339345
},
340346
{
341-
"description": "single fullwidth full stop (RFC 3490#3.1)",
347+
"description": "single fullwidth full stop",
342348
"data": "\uff0e",
343349
"valid": false
344350
},
345351
{
346-
"description": "single halfwidth ideographic full stop (RFC 3490#3.1)",
352+
"description": "single halfwidth ideographic full stop",
347353
"data": "\uff61",
348354
"valid": false
349355
},
350356
{
351-
"description": "ideographic full stop (RFC 3490#3.1) as label separator",
357+
"description": "dot as label separator",
358+
"data": "a.b",
359+
"valid": true
360+
},
361+
{
362+
"description": "ideographic full stop as label separator",
352363
"data": "a\u3002b",
353364
"valid": true
354365
},
355366
{
356-
"description": "fullwidth full stop (RFC 3490#3.1) as label separator",
367+
"description": "fullwidth full stop as label separator",
357368
"data": "a\uff0eb",
358369
"valid": true
359370
},
360371
{
361-
"description": "halfwidth ideographic full stop (RFC 3490#3.1) as label separator",
372+
"description": "halfwidth ideographic full stop as label separator",
362373
"data": "a\uff61b",
363374
"valid": true
364375
}

0 commit comments

Comments
 (0)