minLength.json 886 Bytes
Newer Older
miloyip's avatar
miloyip committed
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
[
    {
        "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
            }
        ]
    }
]