From 1e21fac2cee92fdc2579f0efd5437f8733b242f0 Mon Sep 17 00:00:00 2001 From: sitandr <60141933+sitandr@users.noreply.github.com> Date: Tue, 8 Aug 2023 15:42:04 +0300 Subject: Fix crashing on empty regexps (#1870) --- tests/typ/compiler/show-text.typ | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests') 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 @@ -25,6 +25,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) -- cgit v1.2.3