Debian Codegraph @

share/tests/draft3/divisibleBy.json

raw
1 [
2 {
3 "description": "by int",
4 "schema": {"divisibleBy": 2},
5 "tests": [
6 {
7 "description": "int by int",
8 "data": 10,
9 "valid": true
10 },
11 {
12 "description": "int by int fail",
13 "data": 7,
14 "valid": false
15 },
16 {
17 "description": "ignores non-numbers",
18 "data": "foo",
19 "valid": true
20 }
21 ]
22 },
23 {
24 "description": "by number",
25 "schema": {"divisibleBy": 1.5},
26 "tests": [
27 {
28 "description": "zero is divisible by anything (except 0)",
29 "data": 0,
30 "valid": true
31 },
32 {
33 "description": "4.5 is divisible by 1.5",
34 "data": 4.5,
35 "valid": true
36 },
37 {
38 "description": "-4.5 is divisible by 1.5",
39 "data": -4.5,
40 "valid": true
41 },
42 {
43 "description": "35 is not divisible by 1.5",
44 "data": 35,
45 "valid": false
46 }
47 ]
48 },
49 {
50 "description": "by small number",
51 "schema": {"divisibleBy": 0.0001},
52 "tests": [
53 {
54 "description": "0.0075 is divisible by 0.0001",
55 "data": 0.0075,
56 "valid": true
57 },
58 {
59 "description": "0.00751 is not divisible by 0.0001",
60 "data": 0.00751,
61 "valid": false
62 }
63 ]
64 }
65 ]