Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bnjmnt4n committed Sep 29, 2021
1 parent 5e82fca commit 2def743
Show file tree
Hide file tree
Showing 4 changed files with 676 additions and 3 deletions.
49 changes: 49 additions & 0 deletions tests/test-data-named-groups.json
Original file line number Diff line number Diff line change
Expand Up @@ -218,5 +218,54 @@
"name": "SyntaxError",
"message": "Invalid escape sequence at position 3\n (?<\\u0000>)\n ^",
"input": "(?<\\u0000>)"
},
"{(?<x>)}": {
"type": "alternative",
"body": [
{
"type": "value",
"kind": "symbol",
"codePoint": 123,
"range": [
0,
1
],
"raw": "{"
},
{
"type": "group",
"behavior": "normal",
"body": [],
"range": [
1,
7
],
"raw": "(?<x>)",
"name": {
"type": "identifier",
"value": "x",
"range": [
4,
5
],
"raw": "x"
}
},
{
"type": "value",
"kind": "symbol",
"codePoint": 125,
"range": [
7,
8
],
"raw": "}"
}
],
"range": [
0,
8
],
"raw": "{(?<x>)}"
}
}
115 changes: 115 additions & 0 deletions tests/test-data-unicode.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
},
"[\\u{0}-\\u{A}]": {
"type": "characterClass",
"kind": "union",
"body": [
{
"type": "characterClassRange",
Expand Down Expand Up @@ -150,6 +151,7 @@
},
"[\\u{02}-\\u{003}]": {
"type": "characterClass",
"kind": "union",
"body": [
{
"type": "characterClassRange",
Expand Down Expand Up @@ -189,6 +191,7 @@
},
"[\uD83D\uDCA9-\uD83D\uDCAB]": {
"type": "characterClass",
"kind": "union",
"body": [
{
"type": "characterClassRange",
Expand Down Expand Up @@ -228,6 +231,7 @@
},
"[\\uD83D\\uDCA9-\\uD83D\\uDCAB]": {
"type": "characterClass",
"kind": "union",
"body": [
{
"type": "characterClassRange",
Expand Down Expand Up @@ -267,6 +271,7 @@
},
"[a-b\uD83D\uDCA9-\uD83D\uDCAB]": {
"type": "characterClass",
"kind": "union",
"body": [
{
"type": "characterClassRange",
Expand Down Expand Up @@ -334,6 +339,7 @@
},
"[a-b\\uD83D\\uDCA9-\\uD83D\\uDCAB]": {
"type": "characterClass",
"kind": "union",
"body": [
{
"type": "characterClassRange",
Expand Down Expand Up @@ -401,6 +407,7 @@
},
"[\uD83D\uDCA9-\uD83D\uDCABa-b]": {
"type": "characterClass",
"kind": "union",
"body": [
{
"type": "characterClassRange",
Expand Down Expand Up @@ -468,6 +475,7 @@
},
"[\\uD83D\\uDCA9-\\uD83D\\uDCABa-b]": {
"type": "characterClass",
"kind": "union",
"body": [
{
"type": "characterClassRange",
Expand Down Expand Up @@ -535,6 +543,7 @@
},
"[\uD83D\uDCA9\uD83D\uDCAB]": {
"type": "characterClass",
"kind": "union",
"body": [
{
"type": "value",
Expand Down Expand Up @@ -566,6 +575,7 @@
},
"[\\uD83D\\uDCA9\\uD83D\\uDCAB]": {
"type": "characterClass",
"kind": "union",
"body": [
{
"type": "value",
Expand Down Expand Up @@ -597,6 +607,7 @@
},
"[a-b\uD83D\uDCA9\uD83D\uDCAB]": {
"type": "characterClass",
"kind": "union",
"body": [
{
"type": "characterClassRange",
Expand Down Expand Up @@ -656,6 +667,7 @@
},
"[a-b\\uD83D\\uDCA9\\uD83D\\uDCAB]": {
"type": "characterClass",
"kind": "union",
"body": [
{
"type": "characterClassRange",
Expand Down Expand Up @@ -715,6 +727,7 @@
},
"[\uD83D\uDCA9\uD83D\uDCABa-b]": {
"type": "characterClass",
"kind": "union",
"body": [
{
"type": "value",
Expand Down Expand Up @@ -774,6 +787,7 @@
},
"[\\uD83D\\uDCA9\\uD83D\\uDCABa-b]": {
"type": "characterClass",
"kind": "union",
"body": [
{
"type": "value",
Expand Down Expand Up @@ -925,6 +939,7 @@
},
"[\\-]": {
"type": "characterClass",
"kind": "union",
"body": [
{
"type": "value",
Expand All @@ -946,6 +961,7 @@
},
"[}]": {
"type": "characterClass",
"kind": "union",
"body": [
{
"type": "value",
Expand All @@ -967,6 +983,7 @@
},
"[^}]": {
"type": "characterClass",
"kind": "union",
"body": [
{
"type": "value",
Expand All @@ -985,5 +1002,103 @@
4
],
"raw": "[^}]"
},
"[\\b-e]": {
"type": "characterClass",
"kind": "union",
"body": [
{
"type": "characterClassRange",
"min": {
"type": "value",
"kind": "singleEscape",
"codePoint": 8,
"range": [
1,
3
],
"raw": "\\b"
},
"max": {
"type": "value",
"kind": "symbol",
"codePoint": 101,
"range": [
4,
5
],
"raw": "e"
},
"range": [
1,
5
],
"raw": "\\b-e"
}
],
"negative": false,
"range": [
0,
6
],
"raw": "[\\b-e]"
},
"[e-\\b]": {
"type": "error",
"name": "SyntaxError",
"message": "invalid range in character class at position 1: e-\\b\n [e-\\b]\n ^",
"input": "[e-\\b]"
},
"[\\w-e]": {
"type": "error",
"name": "SyntaxError",
"message": "invalid character class at position 5\n [\\w-e]\n ^",
"input": "[\\w-e]"
},
"[\\0-\\b]": {
"type": "characterClass",
"kind": "union",
"body": [
{
"type": "characterClassRange",
"min": {
"type": "value",
"kind": "null",
"codePoint": 0,
"range": [
1,
3
],
"raw": "\\0"
},
"max": {
"type": "value",
"kind": "singleEscape",
"codePoint": 8,
"range": [
4,
6
],
"raw": "\\b"
},
"range": [
1,
6
],
"raw": "\\0-\\b"
}
],
"negative": false,
"range": [
0,
7
],
"raw": "[\\0-\\b]"
},
"{}": {
"type": "error",
"name": "SyntaxError",
"message": "Expected atom at position 0\n {}\n ^",
"input": "{}"
}
}
Loading

0 comments on commit 2def743

Please sign in to comment.