xref: /freebsd/contrib/libucl/tests/schema/maximum.json (revision 6ba2210ee039f2f12878c217bcf058e9c8b26b29)
1[
2    {
3        "description": "maximum validation",
4        "schema": {"maximum": 3.0},
5        "tests": [
6            {
7                "description": "below the maximum is valid",
8                "data": 2.6,
9                "valid": true
10            },
11            {
12                "description": "above the maximum is invalid",
13                "data": 3.5,
14                "valid": false
15            },
16            {
17                "description": "ignores non-numbers",
18                "data": "x",
19                "valid": true
20            }
21        ]
22    },
23    {
24        "description": "exclusiveMaximum validation",
25        "schema": {
26            "maximum": 3.0,
27            "exclusiveMaximum": true
28        },
29        "tests": [
30            {
31                "description": "below the maximum is still valid",
32                "data": 2.2,
33                "valid": true
34            },
35            {
36                "description": "boundary point is invalid",
37                "data": 3.0,
38                "valid": false
39            }
40        ]
41    }
42]
43