Skip to content

Commit fefa4dc

Browse files
committed
Merge pull request #5 from timjb/master
Added tests for divisibleBy, format: "regex"
2 parents 189e231 + 295d43a commit fefa4dc

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

tests/draft3/divisibleBy.json

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[
2+
{
3+
"description": "divisibleBy validation",
4+
"schema": {"divisibleBy": 1.5},
5+
"tests": [
6+
{
7+
"description": "zero is divisible by anything (except 0)",
8+
"data": 0,
9+
"valid": true
10+
},
11+
{
12+
"description": "4.5 is divisible by 1.5",
13+
"data": 4.5,
14+
"valid": true
15+
},
16+
{
17+
"description": "35 is not divisible by 1.5",
18+
"data": 35,
19+
"valid": false
20+
}
21+
]
22+
}
23+
]

tests/draft3/optional/format.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[
2+
{
3+
"description": "validation of regular expressions",
4+
"schema": {"format": "regex"},
5+
"tests": [
6+
{
7+
"description": "a valid regular expression",
8+
"data": "([abc])+\\s+$",
9+
"valid": true
10+
},
11+
{
12+
"description": "a regular expression with unclosed parens is invalid",
13+
"data": "^(abc]",
14+
"valid": false
15+
}
16+
]
17+
}
18+
]

0 commit comments

Comments
 (0)