Skip to content

Commit 2603133

Browse files
committed
Fix ECMA 262 \Z and \z tests
The old test was incorrect because "\Z" is actually valid. It matches a literal Z in ECMA 262.
1 parent 86f52b8 commit 2603133

File tree

1 file changed

+30
-3
lines changed

1 file changed

+30
-3
lines changed

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

+30-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,38 @@
11
[
22
{
33
"description": "ECMA 262 regex non-compliance",
4-
"schema": { "format": "regex" },
4+
"schema": {
5+
"type": "string",
6+
"pattern": "^x\\Z"
7+
},
8+
"tests": [
9+
{
10+
"description": "\\Z should match literal Z",
11+
"data": "xZ",
12+
"valid": true
13+
},
14+
{
15+
"description": "\\Z should not match end",
16+
"data": "x",
17+
"valid": false
18+
}
19+
]
20+
},
21+
{
22+
"description": "ECMA 262 regex non-compliance",
23+
"schema": {
24+
"type": "string",
25+
"pattern": "^x\\z"
26+
},
527
"tests": [
628
{
7-
"description": "ECMA 262 has no support for \\Z anchor from .NET",
8-
"data": "^\\S(|(.|\\n)*\\S)\\Z",
29+
"description": "\\z should match literal z",
30+
"data": "xz",
31+
"valid": true
32+
},
33+
{
34+
"description": "\\z should not match end",
35+
"data": "x",
936
"valid": false
1037
}
1138
]

0 commit comments

Comments
 (0)