summaryrefslogtreecommitdiffhomepage
path: root/tests/custom/00_syntax/21_regex_literals
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2022-03-15 23:09:56 +0100
committerJo-Philipp Wich <jo@mein.io>2022-03-15 23:15:12 +0100
commitb8f49b1b00c624df1208cd854aa65516b47c4c11 (patch)
tree41257ce6cb39d2c018da0c6e865f8f443803616f /tests/custom/00_syntax/21_regex_literals
parentfd2e5e7e9d216c14d78258cd3420b6225fe91b37 (diff)
tests: 21_regex_literals: generalize syntax error test case
Different libc implementations produce different syntax error messages on invalid regular expression patterns, so rework the test case to produce stable output across all environments. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'tests/custom/00_syntax/21_regex_literals')
-rw-r--r--tests/custom/00_syntax/21_regex_literals16
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/custom/00_syntax/21_regex_literals b/tests/custom/00_syntax/21_regex_literals
index 6d85e97..d7ba7c4 100644
--- a/tests/custom/00_syntax/21_regex_literals
+++ b/tests/custom/00_syntax/21_regex_literals
@@ -73,17 +73,23 @@ In line 2, byte 2:
Testing regex compilation errors.
-- Expect stderr --
-Syntax error: Unmatched \{
-In line 2, byte 3:
+Catched syntax error
+In line 7, byte 30:
- ` /foo {/`
- ^-- Near here
+ ` die("Catched syntax error");`
+ Near here ----------------------------^
-- End --
-- Testcase --
{%
- /foo {/
+ try {
+ /foo (/
+ }
+ catch (e) {
+ if (e.type == "Syntax error")
+ die("Catched syntax error");
+ }
%}
-- End --