summaryrefslogtreecommitdiffhomepage
path: root/tests/custom
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2021-04-29 17:59:40 +0200
committerJo-Philipp Wich <jo@mein.io>2021-04-29 17:59:40 +0200
commit02629b84de23bdc5896ac4b357e2f16dfb3996ec (patch)
treeaf9dc2ca32f02096966b6fd5b1c25fa594b573fe /tests/custom
parent2bc9bace716fafa408dfc6683ca3ff0f9d8bc44b (diff)
lexer: fix infinite loop on parsing unterminated comments
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'tests/custom')
-rw-r--r--tests/custom/03_bugs/18_hang_on_line_comments_at_eof31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/custom/03_bugs/18_hang_on_line_comments_at_eof b/tests/custom/03_bugs/18_hang_on_line_comments_at_eof
new file mode 100644
index 0000000..957ed47
--- /dev/null
+++ b/tests/custom/03_bugs/18_hang_on_line_comments_at_eof
@@ -0,0 +1,31 @@
+When parsing a comment near EOF, or a comment escaping the end
+of an expression block, the lexer did end up in an infinite loop.
+
+-- Expect stderr --
+Syntax error: Expecting expression
+In line 1, byte 9:
+
+ `{{ // }}`
+ ^-- Near here
+
+
+-- End --
+
+-- Testcase --
+{{ // }}
+-- End --
+
+
+-- Expect stderr --
+Syntax error: Unterminated comment
+In line 1, byte 4:
+
+ `{{ /* }}`
+ ^-- Near here
+
+
+-- End --
+
+-- Testcase --
+{{ /* }}
+-- End --