Skip to content

Commit a6a0d0e

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 a6a0d0e

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

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

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,29 @@
11
[
22
{
33
"description": "ECMA 262 regex non-compliance",
4-
"schema": { "format": "regex" },
4+
"schema": {
5+
"type": "string",
6+
"pattern": "^\\S\\Z"
7+
},
58
"tests": [
69
{
7-
"description": "ECMA 262 has no support for \\Z anchor from .NET",
8-
"data": "^\\S(|(.|\\n)*\\S)\\Z",
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+
"description": "\\z should match literal z",
21+
"data": "xz",
22+
"valid": true
23+
},
24+
{
25+
"description": "\\z should not match end",
26+
"data": "x",
927
"valid": false
1028
}
1129
]

0 commit comments

Comments
 (0)