Skip to content

Fix ECMA 262 regex whitespace tests. #380

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 95 additions & 5 deletions tests/draft2019-09/optional/ecmascript-regex.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
]
},
{
"description": "ECMA 262 \\w matches everything but ascii letters",
"description": "ECMA 262 \\W matches everything but ascii letters",
"schema": {
"type": "string",
"pattern": "^\\W$"
Expand All @@ -173,7 +173,7 @@
]
},
{
"description": "ECMA 262 \\s matches ascii whitespace only",
"description": "ECMA 262 \\s matches whitespace",
"schema": {
"type": "string",
"pattern": "^\\s$"
Expand All @@ -185,14 +185,59 @@
"valid": true
},
{
"description": "latin-1 non-breaking-space does not match (unlike e.g. Python)",
"description": "Character tabulation matches",
"data": "\t",
"valid": true
},
{
"description": "Line tabulation matches",
"data": "\u000b",
"valid": true
},
{
"description": "Form feed matches",
"data": "\u000c",
"valid": true
},
{
"description": "latin-1 non-breaking-space matches",
"data": "\u00a0",
"valid": true
},
{
"description": "zero-width whitespace matches",
"data": "\ufeff",
"valid": true
},
{
"description": "line feed matches (line terminator)",
"data": "\u000a",
"valid": true
},
{
"description": "paragraph separator matches (line terminator)",
"data": "\u2029",
"valid": true
},
{
"description": "EM SPACE matches (Space_Separator)",
"data": "\u2003",
"valid": true
},
{
"description": "Non-whitespace control does not match",
"data": "\u0001",
"valid": false
},
{
"description": "Non-whitespace does not match",
"data": "\u2013",
"valid": false
}
]
},
{
"description": "ECMA 262 \\S matches everything but ascii whitespace",
"description": "ECMA 262 \\S matches everything but whitespace",
"schema": {
"type": "string",
"pattern": "^\\S$"
Expand All @@ -204,8 +249,53 @@
"valid": false
},
{
"description": "latin-1 non-breaking-space matches (unlike e.g. Python)",
"description": "Character tabulation does not match",
"data": "\t",
"valid": false
},
{
"description": "Line tabulation does not match",
"data": "\u000b",
"valid": false
},
{
"description": "Form feed does not match",
"data": "\u000c",
"valid": false
},
{
"description": "latin-1 non-breaking-space does not match",
"data": "\u00a0",
"valid": false
},
{
"description": "zero-width whitespace does not match",
"data": "\ufeff",
"valid": false
},
{
"description": "line feed does not match (line terminator)",
"data": "\u000a",
"valid": false
},
{
"description": "paragraph separator does not match (line terminator)",
"data": "\u2029",
"valid": false
},
{
"description": "EM SPACE does not match (Space_Separator)",
"data": "\u2003",
"valid": false
},
{
"description": "Non-whitespace control matches",
"data": "\u0001",
"valid": true
},
{
"description": "Non-whitespace matches",
"data": "\u2013",
"valid": true
}
]
Expand Down
100 changes: 95 additions & 5 deletions tests/draft4/optional/ecmascript-regex.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
]
},
{
"description": "ECMA 262 \\w matches everything but ascii letters",
"description": "ECMA 262 \\W matches everything but ascii letters",
"schema": {
"type": "string",
"pattern": "^\\W$"
Expand All @@ -173,7 +173,7 @@
]
},
{
"description": "ECMA 262 \\s matches ascii whitespace only",
"description": "ECMA 262 \\s matches whitespace",
"schema": {
"type": "string",
"pattern": "^\\s$"
Expand All @@ -185,14 +185,59 @@
"valid": true
},
{
"description": "latin-1 non-breaking-space does not match (unlike e.g. Python)",
"description": "Character tabulation matches",
"data": "\t",
"valid": true
},
{
"description": "Line tabulation matches",
"data": "\u000b",
"valid": true
},
{
"description": "Form feed matches",
"data": "\u000c",
"valid": true
},
{
"description": "latin-1 non-breaking-space matches",
"data": "\u00a0",
"valid": true
},
{
"description": "zero-width whitespace matches",
"data": "\ufeff",
"valid": true
},
{
"description": "line feed matches (line terminator)",
"data": "\u000a",
"valid": true
},
{
"description": "paragraph separator matches (line terminator)",
"data": "\u2029",
"valid": true
},
{
"description": "EM SPACE matches (Space_Separator)",
"data": "\u2003",
"valid": true
},
{
"description": "Non-whitespace control does not match",
"data": "\u0001",
"valid": false
},
{
"description": "Non-whitespace does not match",
"data": "\u2013",
"valid": false
}
]
},
{
"description": "ECMA 262 \\S matches everything but ascii whitespace",
"description": "ECMA 262 \\S matches everything but whitespace",
"schema": {
"type": "string",
"pattern": "^\\S$"
Expand All @@ -204,8 +249,53 @@
"valid": false
},
{
"description": "latin-1 non-breaking-space matches (unlike e.g. Python)",
"description": "Character tabulation does not match",
"data": "\t",
"valid": false
},
{
"description": "Line tabulation does not match",
"data": "\u000b",
"valid": false
},
{
"description": "Form feed does not match",
"data": "\u000c",
"valid": false
},
{
"description": "latin-1 non-breaking-space does not match",
"data": "\u00a0",
"valid": false
},
{
"description": "zero-width whitespace does not match",
"data": "\ufeff",
"valid": false
},
{
"description": "line feed does not match (line terminator)",
"data": "\u000a",
"valid": false
},
{
"description": "paragraph separator does not match (line terminator)",
"data": "\u2029",
"valid": false
},
{
"description": "EM SPACE does not match (Space_Separator)",
"data": "\u2003",
"valid": false
},
{
"description": "Non-whitespace control matches",
"data": "\u0001",
"valid": true
},
{
"description": "Non-whitespace matches",
"data": "\u2013",
"valid": true
}
]
Expand Down
Loading