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

Re: Y01 Test Failure on Arch



> On 6. Apr 2021, at 7.23, Jun T <takimoto-j@xxxxxxxxxxxxxxxxx> wrote:
> 
> Aha!
> It was a mystery for me how you could run Y01 successfully.
> Sorry for not going back to your original post.
> I believe Oliver was just too busy when committing the patch.
> 
> But the test still fails as follows:
> 
> --- /tmp/zsh.ztst.34237/ztst.out	2021-04-06 13:06:20.000000000 +0900
> +++ /tmp/zsh.ztst.34237/ztst.tout	2021-04-06 13:06:20.000000000 +0900
> @@ -8,9 +8,9 @@
> NO:{dir1 dir2 file1 file2}
> DESCRIPTION:{original}
> NO:{*}
> -line: {: dir1/}{}
> line: {: dir2/}{}
> line: {: file1 }{}
> line: {: file2 }{}
> line: {: dir1 dir2 file1 file2 }{}
> line: {: *}{}
> +line: {: dir1/}{}
> 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
> ./Y01completion.ztst: test failed.
> 
> Can you reproduce this?
> Is it OK to replace "comptest $': *\t\t\t\t\t\t\t'" by "comptest $': *\t'"
> as in my patch in workers/48363⁩?

Yes, I can reproduce it. However, I don’t think we should discard all of the additional `\t`s, since it also tests the suffixes that _expand adds, which are different from _complete. I would like to suggest a slightly different fix. See attached patch.

From 032b6bd0b7c90e3bed9fbd7771ea1b6969b4c24f Mon Sep 17 00:00:00 2001
From: Marlon Richert <marlon.richert@xxxxxxxxx>
Date: Tue, 6 Apr 2021 14:29:26 +0300
Subject: [PATCH] Fix _expand completion test

---
 Test/Y01completion.ztst |  3 +--
 Test/comptest           | 11 ++++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/Test/Y01completion.ztst b/Test/Y01completion.ztst
index eff6910c2..858fa7220 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\t\t\t\t\t'
 0:_expand shows file types
 >line: {: dir1/}{}
 >DESCRIPTION:{expansions}
@@ -56,7 +56,6 @@
 >NO:{dir1 dir2 file1 file2}
 >DESCRIPTION:{original}
 >NO:{*}
->line: {: dir1/}{}
 >line: {: dir2/}{}
 >line: {: file1 }{}
 >line: {: file2 }{}
diff --git a/Test/comptest b/Test/comptest
index a36e301e0..79c69979a 100644
--- a/Test/comptest
+++ b/Test/comptest
@@ -40,6 +40,7 @@ KEYTIMEOUT=1
 setopt zle
 autoload -U compinit
 compinit -u
+zstyle ":completion:*" completer _expand _complete _ignored
 zstyle ":completion:*:default" list-colors "no=<NO>" "fi=<FI>" "di=<DI>" "ln=<LN>" "pi=<PI>" "so=<SO>" "bd=<BD>" "cd=<CD>" "ex=<EX>" "mi=<MI>" "tc=<TC>" "sp=<SP>" "lc=<LC>" "ec=<EC>\n" "rc=<RC>"
 zstyle ":completion:*" group-name ""
 zstyle ":completion:*:messages" format "<MESSAGE>%d</MESSAGE>
@@ -50,9 +51,9 @@ zstyle ":completion:*:options" verbose yes
 zstyle ":completion:*:values" verbose yes
 setopt noalwayslastprompt listrowsfirst completeinword
 zmodload zsh/complist
-expand-or-complete-with-report () {
-  print -lr "<WIDGET><expand-or-complete>"
-  zle expand-or-complete
+complete-word-with-report () {
+  print -lr "<WIDGET><complete-word>"
+  zle complete-word
   print -lr - "<LBUFFER>$LBUFFER</LBUFFER>" "<RBUFFER>$RBUFFER</RBUFFER>"
   zle clear-screen
   zle -R
@@ -80,11 +81,11 @@ zle-finish () {
   (( $+mark )) && print -lr "MARK: $mark"
   zle accept-line
 }
-zle -N expand-or-complete-with-report
+zle -N complete-word-with-report
 zle -N list-choices-with-report
 zle -N comp-finish
 zle -N zle-finish
-bindkey "^I" expand-or-complete-with-report
+bindkey "^I" complete-word-with-report
 bindkey "^D" list-choices-with-report
 bindkey "^Z" comp-finish
 bindkey "^X" zle-finish
-- 
2.31.0




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