summary refs log tree commit diff
path: root/Test/V07pcre.ztst
diff options
context:
space:
mode:
Diffstat (limited to 'Test/V07pcre.ztst')
-rw-r--r--Test/V07pcre.ztst6
1 files changed, 6 insertions, 0 deletions
diff --git a/Test/V07pcre.ztst b/Test/V07pcre.ztst
index ad1770712..7426e7bf8 100644
--- a/Test/V07pcre.ztst
+++ b/Test/V07pcre.ztst
@@ -131,6 +131,12 @@
 >78884; ZPCRE_OP: 25 30
 >90210; ZPCRE_OP: 31 36
 
+# Embedded NULs allowed in plaintext, but not in RE (although \0 as two-chars allowed)
+  [[ $'a\0bc\0d' =~ '^(a\0.)(.+)$' ]]
+  print "${#MATCH}; ${#match[1]}; ${#match[2]}"
+0:ensure ASCII NUL passes in and out of matched plaintext
+>6; 3; 3
+
 # Subshell because crash on failure
   ( setopt re_match_pcre
     [[ test.txt =~ '^(.*_)?(test)' ]]