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

Re: Y01 Test Failure on Arch



> 2021/03/31 22:40, Vin Shelton <acs@xxxxxxxxxxxxxxxxxxxx> wrote:
> 
> Building from the latest sources on endeavouros (Arch):
(snip)
> Test ../../../src/zsh-2021-03-31/Test/Y01completion.ztst failed: output differs from expected as shown above for:
>   comptest $': *\t\t\t\t\t\t\t'
> Was testing: _expand shows file types

Same in Ubuntu, Fedora and macOS.

It seems we need to call complete-word instead of expand-or-complete,
and include _expand in the 'completer' style.

The patch below works (all the test pass with the patch), but
I'm not sure this is the best solution.

In the patch I simply replaced expand-or-complete by complete-word
in the function expand-or-complete-with-report() defined in comptest.
(Do we also need to change the function name etc.?)

I also removed extra '\t's from the test since the first \t is enough
for testing whether _expand correctly outputs file types.


diff --git a/Test/Y01completion.ztst b/Test/Y01completion.ztst
index eff6910c2..ff7a28120 100644
--- a/Test/Y01completion.ztst
+++ b/Test/Y01completion.ztst
@@ -44,7 +44,7 @@
 >line: {: dir1/}{}
 >line: {: dir2/}{}
 
-  comptest $': *\t\t\t\t\t\t\t'
+  comptest $': *\t'
 0:_expand shows file types
 >line: {: dir1/}{}
 >DESCRIPTION:{expansions}
@@ -56,12 +56,6 @@
 >NO:{dir1 dir2 file1 file2}
 >DESCRIPTION:{original}
 >NO:{*}
->line: {: dir1/}{}
->line: {: dir2/}{}
->line: {: file1 }{}
->line: {: file2 }{}
->line: {: dir1 dir2 file1 file2 }{}
->line: {: *}{}
 
   comptesteval '_users () { compadd user1 user2 }'
   comptest $': ~\t\t\t\t\t'
diff --git a/Test/comptest b/Test/comptest
index a36e301e0..8f4081b7d 100644
--- a/Test/comptest
+++ b/Test/comptest
@@ -48,11 +48,12 @@ zstyle ":completion:*:descriptions" format "<DESCRIPTION>%d</DESCRIPTION>
 "
 zstyle ":completion:*:options" verbose yes
 zstyle ":completion:*:values" verbose yes
+zstyle ":completion:*" completer _expand _complete
 setopt noalwayslastprompt listrowsfirst completeinword
 zmodload zsh/complist
 expand-or-complete-with-report () {
   print -lr "<WIDGET><expand-or-complete>"
-  zle expand-or-complete
+  zle complete-word
   print -lr - "<LBUFFER>$LBUFFER</LBUFFER>" "<RBUFFER>$RBUFFER</RBUFFER>"
   zle clear-screen
   zle -R










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