summaryrefslogtreecommitdiff
path: root/json/tests/draft2020-12/optional/format/regex.json
blob: 34491770a99ed9a09cc2d6fa93b303884c0dd73e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
[
    {
        "description": "validation of regular expressions",
        "schema": { "format": "regex" },
        "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 regular expression",
                "data": "([abc])+\\s+$",
                "valid": true
            },
            {
                "description": "a regular expression with unclosed parens is invalid",
                "data": "^(abc]",
                "valid": false
            }
        ]
    }
]