Skip to content

Commit e62b64b

Browse files
committed
Squashed 'json/' changes from 586515ef..2d554504
2d554504 Merge pull request #284 from Zac-HD/newlines c8f87892 Add trailine-newline tests for $ pattern git-subtree-dir: json git-subtree-split: 2d554504e53e40ce9438411787d698916f35de8e
1 parent 05fe96a commit e62b64b

File tree

4 files changed

+76
-0
lines changed

4 files changed

+76
-0
lines changed

tests/draft2019-09/optional/ecmascript-regex.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,25 @@
1010
}
1111
]
1212
},
13+
{
14+
"description": "ECMA 262 regex $ does not match trailing newline",
15+
"schema": {
16+
"type": "string",
17+
"pattern": "^abc$"
18+
},
19+
"tests": [
20+
{
21+
"description": "matches in Python, but should not in jsonschema",
22+
"data": "abc\n",
23+
"valid": false
24+
},
25+
{
26+
"description": "should match",
27+
"data": "abc",
28+
"valid": true
29+
}
30+
]
31+
},
1332
{
1433
"description": "ECMA 262 regex converts \\a to ascii BEL",
1534
"schema": {

tests/draft4/optional/ecmascript-regex.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,25 @@
1010
}
1111
]
1212
},
13+
{
14+
"description": "ECMA 262 regex $ does not match trailing newline",
15+
"schema": {
16+
"type": "string",
17+
"pattern": "^abc$"
18+
},
19+
"tests": [
20+
{
21+
"description": "matches in Python, but should not in jsonschema",
22+
"data": "abc\n",
23+
"valid": false
24+
},
25+
{
26+
"description": "should match",
27+
"data": "abc",
28+
"valid": true
29+
}
30+
]
31+
},
1332
{
1433
"description": "ECMA 262 regex converts \\a to ascii BEL",
1534
"schema": {

tests/draft6/optional/ecmascript-regex.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,25 @@
1010
}
1111
]
1212
},
13+
{
14+
"description": "ECMA 262 regex $ does not match trailing newline",
15+
"schema": {
16+
"type": "string",
17+
"pattern": "^abc$"
18+
},
19+
"tests": [
20+
{
21+
"description": "matches in Python, but should not in jsonschema",
22+
"data": "abc\n",
23+
"valid": false
24+
},
25+
{
26+
"description": "should match",
27+
"data": "abc",
28+
"valid": true
29+
}
30+
]
31+
},
1332
{
1433
"description": "ECMA 262 regex converts \\a to ascii BEL",
1534
"schema": {

tests/draft7/optional/ecmascript-regex.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,25 @@
1010
}
1111
]
1212
},
13+
{
14+
"description": "ECMA 262 regex $ does not match trailing newline",
15+
"schema": {
16+
"type": "string",
17+
"pattern": "^abc$"
18+
},
19+
"tests": [
20+
{
21+
"description": "matches in Python, but should not in jsonschema",
22+
"data": "abc\n",
23+
"valid": false
24+
},
25+
{
26+
"description": "should match",
27+
"data": "abc",
28+
"valid": true
29+
}
30+
]
31+
},
1332
{
1433
"description": "ECMA 262 regex converts \\a to ascii BEL",
1534
"schema": {

0 commit comments

Comments
 (0)