zsh-workers
 help / color / mirror / Atom feed
* Y01 Test Failure
@ 2021-03-18 15:20 Vin Shelton
  2021-03-18 15:48 ` Bart Schaefer
  2021-03-18 15:54 ` Bart Schaefer
  0 siblings, 2 replies; 9+ messages in thread
From: Vin Shelton @ 2021-03-18 15:20 UTC (permalink / raw)
  To: Zsh Hackers' List

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

Using the latest sources, I'm seeing:

../../../src/zsh-2021-03-18/Test/Y01completion.ztst: starting.
--- /tmp/zsh.ztst.1124192/ztst.out 2021-03-18 11:16:21.697760953 -0400
+++ /tmp/zsh.ztst.1124192/ztst.tout 2021-03-18 11:16:21.794427968 -0400
@@ -1,4 +1,3 @@
-NO:{<INSERT>menu</INSERT>}
 NO:{a}
 NO:{b}
 NO:{c}
@@ -8,6 +7,7 @@
 NO:{g}
 NO:{h}
 NO:{i}
+NO:{<INSERT>menu</INSERT>}
 NO:{j}
 NO:{k}
 NO:{l}
Test ../../../src/zsh-2021-03-18/Test/Y01completion.ztst failed: output
differs from expected as shown above for:
  comptesteval '_tst() { local disp=( {a..z} ); compadd -ld disp $disp[@];
comppostfuncs=( _pst ) }'
  comptesteval '_pst() { local disp=( "<INSERT>$compstate[insert]</INSERT>"
); compadd -Qld disp $disp }'
  comptesteval "zstyle ':completion:*' menu select=long-list"
  comptest $'tst \C-d'
Was testing:  menu select=long-list starts menu selection for list widgets
../../../src/zsh-2021-03-18/Test/Y01completion.ztst: test failed.
../../../src/zsh-2021-03-18/Test/Y02compmatch.ztst: starting.

HTH,
  Vin

[-- Attachment #2: Type: text/html, Size: 1716 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Y01 Test Failure
  2021-03-18 15:20 Y01 Test Failure Vin Shelton
@ 2021-03-18 15:48 ` Bart Schaefer
  2021-03-18 15:54 ` Bart Schaefer
  1 sibling, 0 replies; 9+ messages in thread
From: Bart Schaefer @ 2021-03-18 15:48 UTC (permalink / raw)
  To: Vin Shelton; +Cc: Zsh Hackers' List

On Thu, Mar 18, 2021 at 8:21 AM Vin Shelton <acs@alumni.princeton.edu> wrote:
>
> Using the latest sources, I'm seeing:

I have exactly the same failure on Ubuntu, test passes on MacOS.  Note
comptesteval does
stty 38400 columns 80 rows 24 tabs -icanon -iexten
and the test listing is 26 elements, so it would not fit on one
"screen" in a single column.

I don't know why that would behave differently on different OS.
Difference in terminal definition for "vt100"?


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Y01 Test Failure
  2021-03-18 15:20 Y01 Test Failure Vin Shelton
  2021-03-18 15:48 ` Bart Schaefer
@ 2021-03-18 15:54 ` Bart Schaefer
  2021-03-19  6:00   ` Jun T
  1 sibling, 1 reply; 9+ messages in thread
From: Bart Schaefer @ 2021-03-18 15:54 UTC (permalink / raw)
  To: Vin Shelton; +Cc: Zsh Hackers' List

On Thu, Mar 18, 2021 at 8:21 AM Vin Shelton <acs@alumni.princeton.edu> wrote:
>
> @@ -8,6 +7,7 @@
>  NO:{g}
>  NO:{h}
>  NO:{i}
> +NO:{<INSERT>menu</INSERT>}
>  NO:{j}
>  NO:{k}
>  NO:{l}

If I change comptesteval to stty "rows 48" then this changes to:

@@ -8,6 +7,7 @@
 NO:{g}
 NO:{h}
 NO:{i}
+NO:{<INSERT></INSERT>}
 NO:{j}
 NO:{k}
 NO:{l}

So it does have something to do with tty size/definition.  Also looks
like the order in which the pseudo-tty driver is returning control
sequences may be different.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Y01 Test Failure
  2021-03-18 15:54 ` Bart Schaefer
@ 2021-03-19  6:00   ` Jun T
  2021-03-19  8:27     ` Mikael Magnusson
  0 siblings, 1 reply; 9+ messages in thread
From: Jun T @ 2021-03-19  6:00 UTC (permalink / raw)
  To: zsh-workers

I *guess* the difference is in how the list is sorted.
On macOS '<INSERT>' comes before 'a', while on Linux it is between 'i' and 'j'.
I don't know why '<' is not used for sorting on Linux, but if <INSERT> is replaced
by <BBB>, for example, it is listed between 'b' and 'c' on Linux.

It would be sufficient to replace <INSERT> by any string whose sort order is more
stable across different OSs.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Y01 Test Failure
  2021-03-19  6:00   ` Jun T
@ 2021-03-19  8:27     ` Mikael Magnusson
  2021-03-19 10:42       ` Jun T
  0 siblings, 1 reply; 9+ messages in thread
From: Mikael Magnusson @ 2021-03-19  8:27 UTC (permalink / raw)
  To: Jun T; +Cc: zsh-workers

On 3/19/21, Jun T <takimoto-j@kba.biglobe.ne.jp> wrote:
> I *guess* the difference is in how the list is sorted.
> On macOS '<INSERT>' comes before 'a', while on Linux it is between 'i' and
> 'j'.
> I don't know why '<' is not used for sorting on Linux, but if <INSERT> is
> replaced
> by <BBB>, for example, it is listed between 'b' and 'c' on Linux.
>
> It would be sufficient to replace <INSERT> by any string whose sort order is
> more
> stable across different OSs.

Is this happening even with LC_COLLATE=C, or did we not bother setting
that for this specific test?

-- 
Mikael Magnusson


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Y01 Test Failure
  2021-03-19  8:27     ` Mikael Magnusson
@ 2021-03-19 10:42       ` Jun T
  2021-03-22  2:09         ` dana
  0 siblings, 1 reply; 9+ messages in thread
From: Jun T @ 2021-03-19 10:42 UTC (permalink / raw)
  To: zsh-workers


> 2021/03/19 17:27, Mikael Magnusson <mikachu@gmail.com> wrote:
> 
> Is this happening even with LC_COLLATE=C, or did we not bother setting
> that for this specific test?

LC_ALL is set to en_US.UTF-8 at the start of Y01completion.ztst.

I've been thinking that comparison of all-ASCII strings is the same
in C and UTF-8 locales. But it turned out that strcoll() behaves quite
*strangely* under en_US.UTf-8 on Linux.

If I run the following C-code:

#include <stdio.h>
#include <string.h>
#include <locale.h>

int main() {
    char* s[] = { "h", "i", "j" };
    setlocale(LC_COLLATE, "");
    for(int i=0; i<3; ++i) {
        printf("'%s'  - '<INSERT>' = %d\n", s[i], strcoll(s[i], "<INSERT>"));
    }
    return 0;
}

% export LC_COLLATE=C          
% ./a.out
'h'  - '<INSERT>' = 44
'i'  - '<INSERT>' = 45
'j'  - '<INSERT>' = 46
% export LC_COLLATE=en_US.UTF-8
% ./a.out
'h'  - '<INSERT>' = -11
'i'  - '<INSERT>' = -1
'j'  - '<INSERT>' = 1
% export LC_COLLATE=ja_JP.UTF-8
% ./a.out
'h'  - '<INSERT>' = 44
'i'  - '<INSERT>' = 45
'j'  - '<INSERT>' = 46

I can't understand the behavior under en_US.UTF-8 locale.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Y01 Test Failure
  2021-03-19 10:42       ` Jun T
@ 2021-03-22  2:09         ` dana
  2021-03-22 11:06           ` Vin Shelton
  0 siblings, 1 reply; 9+ messages in thread
From: dana @ 2021-03-22  2:09 UTC (permalink / raw)
  To: Zsh hackers list

Sorry i missed this, i was also using macOS when i tried it.

I only looked for a minute, but could we just do this? It seems to fix the
problem for me on Ubuntu, at least.

(Or, if it's useful in general, we could make comptest set LANG instead of
LC_ALL, and then force LC_COLLATE to C. But again i didn't check to see if
that would break something else)

dana


diff --git a/Test/Y01completion.ztst b/Test/Y01completion.ztst
index f6474c4a1..571f3cf16 100644
--- a/Test/Y01completion.ztst
+++ b/Test/Y01completion.ztst
@@ -240,7 +240,10 @@ F:regression test workers/31611
   comptesteval '_tst() { local disp=( {a..z} ); compadd -ld disp $disp[@]; comppostfuncs=( _pst ) }'
   comptesteval '_pst() { local disp=( "<INSERT>$compstate[insert]</INSERT>" ); compadd -Qld disp $disp }'
   comptesteval "zstyle ':completion:*' menu select=long-list"
+  # This test is sensitive to sorting differences across platforms
+  comptesteval 'export LC_ALL=C'
   comptest $'tst \C-d'
+  comptesteval "export LC_ALL=${(q)ZSH_TEST_LANG}"
 0: menu select=long-list starts menu selection for list widgets
 >NO:{<INSERT>menu</INSERT>}
 >NO:{a}



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Y01 Test Failure
  2021-03-22  2:09         ` dana
@ 2021-03-22 11:06           ` Vin Shelton
  2021-03-28  5:25             ` dana
  0 siblings, 1 reply; 9+ messages in thread
From: Vin Shelton @ 2021-03-22 11:06 UTC (permalink / raw)
  To: dana; +Cc: Zsh hackers list

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

WFM here on Arch.

  - Vin

On Sun, Mar 21, 2021 at 10:10 PM dana <dana@dana.is> wrote:

> Sorry i missed this, i was also using macOS when i tried it.
>
> I only looked for a minute, but could we just do this? It seems to fix the
> problem for me on Ubuntu, at least.
>
> (Or, if it's useful in general, we could make comptest set LANG instead of
> LC_ALL, and then force LC_COLLATE to C. But again i didn't check to see if
> that would break something else)
>
> dana
>
>
> diff --git a/Test/Y01completion.ztst b/Test/Y01completion.ztst
> index f6474c4a1..571f3cf16 100644
> --- a/Test/Y01completion.ztst
> +++ b/Test/Y01completion.ztst
> @@ -240,7 +240,10 @@ F:regression test workers/31611
>    comptesteval '_tst() { local disp=( {a..z} ); compadd -ld disp
> $disp[@]; comppostfuncs=( _pst ) }'
>    comptesteval '_pst() { local disp=(
> "<INSERT>$compstate[insert]</INSERT>" ); compadd -Qld disp $disp }'
>    comptesteval "zstyle ':completion:*' menu select=long-list"
> +  # This test is sensitive to sorting differences across platforms
> +  comptesteval 'export LC_ALL=C'
>    comptest $'tst \C-d'
> +  comptesteval "export LC_ALL=${(q)ZSH_TEST_LANG}"
>  0: menu select=long-list starts menu selection for list widgets
>  >NO:{<INSERT>menu</INSERT>}
>  >NO:{a}
>
>
>

[-- Attachment #2: Type: text/html, Size: 2038 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Y01 Test Failure
  2021-03-22 11:06           ` Vin Shelton
@ 2021-03-28  5:25             ` dana
  0 siblings, 0 replies; 9+ messages in thread
From: dana @ 2021-03-28  5:25 UTC (permalink / raw)
  To: Vin Shelton; +Cc: Zsh hackers list

On 22 Mar 2021, at 06:06, Vin Shelton <acs@alumni.princeton.edu> wrote:
> WFM here on Arch.

Thanks. I committed it like that, we can revisit later if we want to make it
fancier

dana



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-03-28  5:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-18 15:20 Y01 Test Failure Vin Shelton
2021-03-18 15:48 ` Bart Schaefer
2021-03-18 15:54 ` Bart Schaefer
2021-03-19  6:00   ` Jun T
2021-03-19  8:27     ` Mikael Magnusson
2021-03-19 10:42       ` Jun T
2021-03-22  2:09         ` dana
2021-03-22 11:06           ` Vin Shelton
2021-03-28  5:25             ` dana

zsh-workers

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/zsh-workers

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 zsh-workers zsh-workers/ http://inbox.vuxu.org/zsh-workers \
		zsh-workers@zsh.org
	public-inbox-index zsh-workers

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.workers


code repositories for the project(s) associated with this inbox:

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

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git