Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] Extend (z) test with data that seemed to cause fail



On Thu, 09 Mar 2017 00:16:36 -0800
Sebastian Gniazdowski <psprint3@xxxxxxxxxxxx> wrote:
> I have a finished script where I use (z). I once feed it a data:
> 
> ^FZUI^_ text-field example:
> ^Zzuitfieldtfield1_1^Z''^Z''^Z1^ZZUI\[my_tfield1_width\]^ZZUI\[my_tfield1_start\]^ZZUI\[my_tfield1_data\]^\
> 
> on which for 4th "^Z..." segment it was returning multiple segments.
> This happened for 5 minutes, then it stopped. Because I wasn't touching
> the script-black-box, I think it's really a (z) thing. I suspect some
> missing "calloc" instead of "malloc", etc. So maybe it's worth adding
> this test case (patch attached) to D04parameter with this exact data:
> 
>   foo="^FZUI^_ text-field example:
>   ^Zzuitfieldtfield1_1^Z''^Z''^Z1^ZZUI\[my_tfield1_width\]^ZZUI\[my_tfield1_start\]^ZZUI\[my_tfield1_data\]^\"
>   print "${#${(z@)foo}}"
> 0:Test real-world data that once seemed to fail
> >4

I've turned the file text into printable characters like this.

pws

diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst
index fba95cc..704c599 100644
--- a/Test/D04parameter.ztst
+++ b/Test/D04parameter.ztst
@@ -640,6 +640,11 @@
 >echo
 >$(|||) bar
 
+  foo=$'\x06ZUI\x1f text-field example: \x1azuitfieldtfield1_1\x1a\'\'\x1a\'\'\x1a1\x1aZUI\[my_tfield1_width\]\x1aZUI\[my_tfield1_start\]\x1aZUI\[my_tfield1_data\]\x1c'
+  print "${#${(z@)foo}}"
+0:Test real-world data that once seemed to fail
+>4
+
   psvar=(dog)
   setopt promptsubst
   foo='It shouldn'\''t $(happen) to a %1v.'



Messages sorted by: Reverse Date, Date, Thread, Author