summaryrefslogtreecommitdiff
path: root/json/tests/draft4/optional/format/hostname.json
diff options
context:
space:
mode:
Diffstat (limited to 'json/tests/draft4/optional/format/hostname.json')
-rw-r--r--json/tests/draft4/optional/format/hostname.json38
1 files changed, 36 insertions, 2 deletions
diff --git a/json/tests/draft4/optional/format/hostname.json b/json/tests/draft4/optional/format/hostname.json
index e913aba..8a67fda 100644
--- a/json/tests/draft4/optional/format/hostname.json
+++ b/json/tests/draft4/optional/format/hostname.json
@@ -1,14 +1,49 @@
[
{
"description": "validation of host names",
- "schema": {"format": "hostname"},
+ "schema": { "format": "hostname" },
"tests": [
{
+ "description": "all string formats ignore integers",
+ "data": 12,
+ "valid": true
+ },
+ {
+ "description": "all string formats ignore floats",
+ "data": 13.7,
+ "valid": true
+ },
+ {
+ "description": "all string formats ignore objects",
+ "data": {},
+ "valid": true
+ },
+ {
+ "description": "all string formats ignore arrays",
+ "data": [],
+ "valid": true
+ },
+ {
+ "description": "all string formats ignore booleans",
+ "data": false,
+ "valid": true
+ },
+ {
+ "description": "all string formats ignore nulls",
+ "data": null,
+ "valid": true
+ },
+ {
"description": "a valid host name",
"data": "www.example.com",
"valid": true
},
{
+ "description": "a valid punycoded IDN hostname",
+ "data": "xn--4gbwdl.xn--wgbh1c",
+ "valid": true
+ },
+ {
"description": "a host name starting with an illegal character",
"data": "-a-host-name-that-starts-with--",
"valid": false
@@ -61,4 +96,3 @@
]
}
]
-