summaryrefslogtreecommitdiff
path: root/tests/typ
diff options
context:
space:
mode:
authorsitandr <60141933+sitandr@users.noreply.github.com>2023-08-08 15:42:04 +0300
committerGitHub <noreply@github.com>2023-08-08 14:42:04 +0200
commit1e21fac2cee92fdc2579f0efd5437f8733b242f0 (patch)
treeced87b20fbfac2c1bf48779000e9f5b9e561a1c7 /tests/typ
parent2ea451b83b919e5ed59ad203bb22efa844660bd1 (diff)
Fix crashing on empty regexps (#1870)
Diffstat (limited to 'tests/typ')
-rw-r--r--tests/typ/compiler/show-text.typ13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/typ/compiler/show-text.typ b/tests/typ/compiler/show-text.typ
index e635574c..c279507b 100644
--- a/tests/typ/compiler/show-text.typ
+++ b/tests/typ/compiler/show-text.typ
@@ -26,6 +26,19 @@ AA (8)
Treeworld, the World of worlds, is a world.
---
+// Test there is no crashing on empty strings
+// Error: 1:7-1:9 text selector is empty
+#show "": []
+
+---
+// Error: 1:7-1:16 regex selector is empty
+#show regex(""): [AA]
+
+---
+// Error: 1:7-1:42 regex matches empty text
+#show regex("(VAR_GLOBAL|END_VAR||BOOL)") : []
+
+---
// This is a fun one.
#set par(justify: true)
#show regex("\S"): letter => box(stroke: 1pt, inset: 2pt, upper(letter))