summaryrefslogtreecommitdiff
path: root/json/tests/draft-next/minLength.json
blob: 64db9480581aa5d1fe3f81ee0a7305c5fdf0cbbc (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
49
[
    {
        "description": "minLength validation",
        "schema": {"minLength": 2},
        "tests": [
            {
                "description": "longer is valid",
                "data": "foo",
                "valid": true
            },
            {
                "description": "exact length is valid",
                "data": "fo",
                "valid": true
            },
            {
                "description": "too short is invalid",
                "data": "f",
                "valid": false
            },
            {
                "description": "ignores non-strings",
                "data": 1,
                "valid": true
            },
            {
                "description": "one supplementary Unicode code point is not long enough",
                "data": "\uD83D\uDCA9",
                "valid": false
            }
        ]
    },
    {
        "description": "minLength validation with a decimal",
        "schema": {"minLength": 2.0},
        "tests": [
            {
                "description": "longer is valid",
                "data": "foo",
                "valid": true
            },
            {
                "description": "too short is invalid",
                "data": "f",
                "valid": false
            }
        ]
    }
]