Skip to content

Commit 20d15a8

Browse files
committed
Move test of \a regex character to optional/format/regex
This was validating "\\a" as a schema `pattern` described by the meta-schema as format: regex. This moves it to directly test the pattern against a format: regex schema.
1 parent 2f3b5f7 commit 20d15a8

File tree

4 files changed

+10
-28
lines changed

4 files changed

+10
-28
lines changed

tests/draft-next/optional/ecmascript-regex.json

-14
Original file line numberDiff line numberDiff line change
@@ -405,20 +405,6 @@
405405
}
406406
]
407407
},
408-
{
409-
"description": "\\a is not an ECMA 262 control escape",
410-
"schema": {
411-
"$schema": "https://json-schema.org/draft/next/schema",
412-
"$ref": "https://json-schema.org/draft/next/schema"
413-
},
414-
"tests": [
415-
{
416-
"description": "when used as a pattern",
417-
"data": { "pattern": "\\a" },
418-
"valid": false
419-
}
420-
]
421-
},
422408
{
423409
"description": "pattern with non-ASCII digits",
424410
"schema": {

tests/draft-next/optional/format/regex.json

+5
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@
4545
"description": "a regular expression with unclosed parens is invalid",
4646
"data": "^(abc]",
4747
"valid": false
48+
},
49+
{
50+
"description": "\\a is not an ECMA 262 control escape",
51+
"data": "\\a",
52+
"valid": false
4853
}
4954
]
5055
}

tests/draft2020-12/optional/ecmascript-regex.json

-14
Original file line numberDiff line numberDiff line change
@@ -405,20 +405,6 @@
405405
}
406406
]
407407
},
408-
{
409-
"description": "\\a is not an ECMA 262 control escape",
410-
"schema": {
411-
"$schema": "https://json-schema.org/draft/2020-12/schema",
412-
"$ref": "https://json-schema.org/draft/2020-12/schema"
413-
},
414-
"tests": [
415-
{
416-
"description": "when used as a pattern",
417-
"data": { "pattern": "\\a" },
418-
"valid": false
419-
}
420-
]
421-
},
422408
{
423409
"description": "pattern with non-ASCII digits",
424410
"schema": {

tests/draft2020-12/optional/format/regex.json

+5
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@
4545
"description": "a regular expression with unclosed parens is invalid",
4646
"data": "^(abc]",
4747
"valid": false
48+
},
49+
{
50+
"description": "\\a is not an ECMA 262 control escape",
51+
"data": "\\a",
52+
"valid": false
4853
}
4954
]
5055
}

0 commit comments

Comments
 (0)