summary refs log tree commit diff
path: root/Test/V07pcre.ztst
diff options
context:
space:
mode:
authorPhil Pennock <zsh-workers+phil.pennock@spodhuis.org>2017-06-15 16:40:50 -0400
committerPeter Stephenson <pws@zsh.org>2017-06-22 09:24:33 +0100
commit825f84c77e7e6f31d5f0fc9dd636198477c9a357 (patch)
tree79da02703ec0fcdef2be8b87b4bf7c3ded764b09 /Test/V07pcre.ztst
parent8a62bbb46a3c916a42e7baa83df7b8ada3cf1ede (diff)
downloadzsh-825f84c77e7e6f31d5f0fc9dd636198477c9a357.tar.gz
zsh-825f84c77e7e6f31d5f0fc9dd636198477c9a357.tar.xz
zsh-825f84c77e7e6f31d5f0fc9dd636198477c9a357.zip
41308 (tweaked): behaviour of PCRE with NUL bytes
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)' ]]