[
    {
        "description": "simple enum validation",
        "schema": {"enum": [1, 2, 3]},
        "tests": [
            {
                "description": "one of the enum is valid",
                "data": 1,
                "valid": true
            },
            {
                "description": "something else is invalid",
                "data": 4,
                "valid": false
            }
        ]
    },
    {
        "description": "heterogeneous enum validation",
        "schema": {"enum": [6, "foo", [], true, {"foo": 12}]},
        "tests": [
            {
                "description": "one of the enum is valid",
                "data": [],
                "valid": true
            },
            {
                "description": "something else is invalid",
                "data": null,
                "valid": false
            },
            {
                "description": "objects are deep compared",
                "data": {"foo": false},
                "valid": false
            }
        ]
    },
    {
        "description": "heterogeneous enum-with-null validation",
        "schema": { "enum": [6, null] },
        "tests": [
            {
                "description": "null is valid",
                "data": null,
                "valid": true
            },
            {
                "description": "number is valid",
                "data": 6,
                "valid": true
            },
            {
                "description": "something else is invalid",
                "data": "test",
                "valid": false
            }
        ]
    },
    {
        "description": "enums in properties",
        "schema": {
            "type":"object",
            "properties": {
                "foo": {"enum":["foo"]},
                "bar": {"enum":["bar"], "required":true}
            }
        },
        "tests": [
            {
                "description": "both properties are valid",
                "data": {"foo":"foo", "bar":"bar"},
                "valid": true
            },
            {
                "description": "wrong foo value",
                "data": {"foo":"foot", "bar":"bar"},
                "valid": false
            },
            {
                "description": "wrong bar value",
                "data": {"foo":"foo", "bar":"bart"},
                "valid": false
            },
            {
                "description": "missing optional property is valid",
                "data": {"bar":"bar"},
                "valid": true
            },
            {
                "description": "missing required property is invalid",
                "data": {"foo":"foo"},
                "valid": false
            },
            {
                "description": "missing all properties is invalid",
                "data": {},
                "valid": false
            }
        ]
    },
    {
        "description": "nul characters in strings",
        "schema": { "enum": [ "hello\u0000there" ] },
        "tests": [
            {
                "description": "match string with nul",
                "data": "hello\u0000there",
                "valid": true
            },
            {
                "description": "do not match string lacking nul",
                "data": "hellothere",
                "valid": false
            }
        ]
    }
]
