zsh-workers
 help / color / mirror / code / Atom feed
From: Marlon <marlon.richert@gmail.com>
To: Jun T <takimoto-j@kba.biglobe.ne.jp>, Oliver Kiddle <opk@zsh.org>
Cc: zsh-workers@zsh.org
Subject: Re: Y01 Test Failure on Arch
Date: Tue, 6 Apr 2021 14:38:36 +0300	[thread overview]
Message-ID: <D8772F93-E707-4F67-BC49-91EFB2C4882C@gmail.com> (raw)
In-Reply-To: <89AC4C5F-AF90-4A01-B0AD-F2326D28F132@kba.biglobe.ne.jp>

[-- Attachment #1: Type: text/plain, Size: 1314 bytes --]


> On 6. Apr 2021, at 7.23, Jun T <takimoto-j@kba.biglobe.ne.jp> 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.


[-- Attachment #2: 0001-Fix-_expand-completion-test.txt --]
[-- Type: text/plain, Size: 2398 bytes --]

From 032b6bd0b7c90e3bed9fbd7771ea1b6969b4c24f Mon Sep 17 00:00:00 2001
From: Marlon Richert <marlon.richert@gmail.com>
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


[-- Attachment #3: Type: text/plain, Size: 2 bytes --]




  reply	other threads:[~2021-04-06 11:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-31 13:40 Vin Shelton
2021-04-01  4:05 ` Jun T
2021-04-03 11:32   ` Vin Shelton
2021-04-04  4:05     ` Jun. T
2021-04-04 14:00       ` Vin Shelton
2021-04-04 17:02         ` Daniel Shahaf
2021-04-05 14:58           ` Marlon Richert
2021-04-06  4:23             ` Jun T
2021-04-06 11:38               ` Marlon [this message]
2021-04-06  9:53             ` Oliver Kiddle
2021-04-04 18:27         ` Bart Schaefer
2021-04-05  0:39           ` Vin Shelton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D8772F93-E707-4F67-BC49-91EFB2C4882C@gmail.com \
    --to=marlon.richert@gmail.com \
    --cc=opk@zsh.org \
    --cc=takimoto-j@kba.biglobe.ne.jp \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).