Debian Codegraph @

share/tests/draft3/optional/format/host-name.json

raw
1 [
2 {
3 "description": "validation of host names",
4 "schema": { "format": "host-name" },
5 "tests": [
6 {
7 "description": "a valid host name",
8 "data": "www.example.com",
9 "valid": true
10 },
11 {
12 "description": "a host name starting with an illegal character",
13 "data": "-a-host-name-that-starts-with--",
14 "valid": false
15 },
16 {
17 "description": "a host name containing illegal characters",
18 "data": "not_a_valid_host_name",
19 "valid": false
20 },
21 {
22 "description": "a host name with a component too long",
23 "data": "a-vvvvvvvvvvvvvvvveeeeeeeeeeeeeeeerrrrrrrrrrrrrrrryyyyyyyyyyyyyyyy-long-host-name-component",
24 "valid": false
25 },
26 {
27 "description": "starts with hyphen",
28 "data": "-hostname",
29 "valid": false
30 },
31 {
32 "description": "ends with hyphen",
33 "data": "hostname-",
34 "valid": false
35 },
36 {
37 "description": "starts with underscore",
38 "data": "_hostname",
39 "valid": false
40 },
41 {
42 "description": "ends with underscore",
43 "data": "hostname_",
44 "valid": false
45 },
46 {
47 "description": "contains underscore",
48 "data": "host_name",
49 "valid": false
50 },
51 {
52 "description": "maximum label length",
53 "data": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk.com",
54 "valid": true
55 },
56 {
57 "description": "exceeds maximum label length",
58 "data": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl.com",
59 "valid": false
60 },
61 {
62 "description": "empty string",
63 "data": "",
64 "valid": false
65 }
66 ]
67 }
68 ]