about summary refs log tree commit diff
path: root/Test
diff options
context:
space:
mode:
authorMikael Magnusson <mikachu@gmail.com>2021-03-12 03:50:01 +0100
committerMikael Magnusson <mikachu@gmail.com>2021-04-01 09:50:52 +0200
commitea3351c49610355512672ab478c715ba3cb92aef (patch)
treec9abcd8fe0a157a0980d09c6fc62dd039f186852 /Test
parent3afdfef31cf5da224c2e69bb0b942412cbf78b59 (diff)
downloadzsh-ea3351c49610355512672ab478c715ba3cb92aef.tar.gz
zsh-ea3351c49610355512672ab478c715ba3cb92aef.tar.xz
zsh-ea3351c49610355512672ab478c715ba3cb92aef.zip
48202 + 48366: Fix handling of NUL bytes in zexpandtabs multibyte version
Diffstat (limited to 'Test')
-rw-r--r--Test/B03print.ztst9
1 files changed, 5 insertions, 4 deletions
diff --git a/Test/B03print.ztst b/Test/B03print.ztst
index 563423934..4d2cf9764 100644
--- a/Test/B03print.ztst
+++ b/Test/B03print.ztst
@@ -304,15 +304,16 @@
  foo=$'one\ttwo\tthree\tfour\n'
  foo+=$'\tone\ttwo\tthree\tfour\n'
  foo+=$'\t\tone\t\ttwo\t\tthree\t\tfour'
- print -x4 $foo
- print -X4 $foo
+ foo+='\0' # regression test for multibyte tab expand
+ print -x4 $foo | tr '\0' Z # avoid raw nul byte in expected output below
+ print -X4 $foo | tr '\0' Z
 0:Tab expansion by print
 >one	two	three	four
 >    one	two	three	four
->        one		two		three		four
+>        one		two		three		fourZ
 >one two three   four
 >    one two three   four
->        one     two     three       four
+>        one     two     three       fourZ
 
  unset foo
  print -v foo once more