diff options
author | Jo-Philipp Wich <jo@mein.io> | 2022-10-04 21:43:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-04 21:43:34 +0200 |
commit | a5e59c9e93b9d435caa3fe786c745f0357bb3c0f (patch) | |
tree | 9ac67ae6b7d0d56f6bfdfe40299cddd4fe5c1eaf /tests/custom/00_syntax/21_regex_literals | |
parent | d64d5d685d86b38dda8a314b7d1404633e26b346 (diff) | |
parent | 76d396d3781b9c6a32897b5d93769db2c9f84d36 (diff) |
Merge pull request #108 from jow-/optimizations
Various improvements
Diffstat (limited to 'tests/custom/00_syntax/21_regex_literals')
-rw-r--r-- | tests/custom/00_syntax/21_regex_literals | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/tests/custom/00_syntax/21_regex_literals b/tests/custom/00_syntax/21_regex_literals index d7ba7c4..7466a2e 100644 --- a/tests/custom/00_syntax/21_regex_literals +++ b/tests/custom/00_syntax/21_regex_literals @@ -4,7 +4,7 @@ within regular expression literals is subject of the underlying regular expression engine. -- Expect stdout -- -[ "/Hello world/", "/test/gis", "/test/g", "/test1 \\\/ test2/", "/\\x31\n\\.\u0007\b\\c\\u2600\\\\/" ] +[ "/Hello world/", "/test/gis", "/test/g", "/test1 / test2/", "/1\n\\.\u0007\bc☀\\\\/" ] -- End -- -- Testcase -- @@ -93,3 +93,27 @@ In line 7, byte 30: } %} -- End -- + + +Testing that slashes within character classes are not treated as regex +literal delimitters. + +-- Expect stdout -- +[ + "/[/]/", + "/[[./.]/]/", + "/[[:alpha:]/]/", + "/[[=/=]/]/" +] +-- End -- + +-- Testcase -- +{% + printf("%.J\n", [ + /[/]/, + /[[./.]/]/, + /[[:alpha:]/]/, + /[[=/=]/]/ + ]); +%} +-- End -- |