zsh-workers
 help / color / mirror / code / Atom feed
* Test "failure" on multibyte conversions
@ 2023-09-23 15:52 Bart Schaefer
  2023-09-24  2:10 ` Jun. T
  0 siblings, 1 reply; 4+ messages in thread
From: Bart Schaefer @ 2023-09-23 15:52 UTC (permalink / raw)
  To: Zsh hackers list

5.4.0-162-generic #179-Ubuntu
zsh-5.9-271-ge4e9afe

./D04parameter.ztst: starting.
Test ./D04parameter.ztst failed: bad status 0, expected 1 from:
  : ${(#X):-0x80}
Was testing: ${(#X)...}: out-of-range character

Is this just a case of a test lagging the code?  This test passes on

Darwin Kernel Version 17.7.0


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

* Re: Test "failure" on multibyte conversions
  2023-09-23 15:52 Test "failure" on multibyte conversions Bart Schaefer
@ 2023-09-24  2:10 ` Jun. T
  2023-09-24 14:00   ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Jun. T @ 2023-09-24  2:10 UTC (permalink / raw)
  To: zsh-workers


> 2023/09/24 0:52、Bart Schaefer <schaefer@brasslantern.com> wrote:
> 
> 5.4.0-162-generic #179-Ubuntu
> zsh-5.9-271-ge4e9afe
> 
> ./D04parameter.ztst: starting.
> Test ./D04parameter.ztst failed: bad status 0, expected 1 from:
>  : ${(#X):-0x80}
> Was testing: ${(#X)...}: out-of-range character

I can't reproduce this error (with zsh-5.9-271-ge4e9afe) on
  5.15.0-75-generic #82~20.04.1-Ubuntu
or
  6.2.0-33-generic #33~22.04.1-Ubuntu.

I guess wctomb() behaves differently on your Ubuntu. What do
you get by running the following C code? On my Ubuntu I get -1.

# On my Mac I get 1, but wctomb() is not used on macOS since
# __STDC_ISO_10646__ is not defined.


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

int main()
{
	char buf[MB_CUR_MAX];
	setlocale(LC_ALL, "C");
	printf("%d\n", wctomb(buf, 0x80));
	return 0;
}



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

* Re: Test "failure" on multibyte conversions
  2023-09-24  2:10 ` Jun. T
@ 2023-09-24 14:00   ` Bart Schaefer
  2023-09-26 17:13     ` Jun. T
  0 siblings, 1 reply; 4+ messages in thread
From: Bart Schaefer @ 2023-09-24 14:00 UTC (permalink / raw)
  To: Jun. T; +Cc: zsh-workers

On Sat, Sep 23, 2023 at 9:11 PM Jun. T <takimoto-j@kba.biglobe.ne.jp> wrote:
>
> > 2023/09/24 0:52、Bart Schaefer <schaefer@brasslantern.com> wrote:
> >
> > Test ./D04parameter.ztst failed: bad status 0, expected 1 from:
> >  : ${(#X):-0x80}
> > Was testing: ${(#X)...}: out-of-range character
>
> I can't reproduce this error

Aha.  I re-ran configure and now the test passes.  I think it may be
the one and only test that fails with --disable-multibyte


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

* Re: Test "failure" on multibyte conversions
  2023-09-24 14:00   ` Bart Schaefer
@ 2023-09-26 17:13     ` Jun. T
  0 siblings, 0 replies; 4+ messages in thread
From: Jun. T @ 2023-09-26 17:13 UTC (permalink / raw)
  To: zsh-workers


> 2023/09/24 23:00, Bart Schaefer <schaefer@brasslantern.com> wrote:
> 
> I think it may be
> the one and only test that fails with --disable-multibyte

Skip two test hunks.


diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst
index 12ae1a446..c2008582c 100644
--- a/Test/D04parameter.ztst
+++ b/Test/D04parameter.ztst
@@ -2807,21 +2807,29 @@ F:behavior, see http://austingroupbugs.net/view.php?id=888
 0:${(#)...}: array of bad math expressions, printf
 >az
 
-  : ${(#X):-0x80}
+  if [[ ! -o multibyte ]]; then
+    ZTST_skip='(#X) accepts any byte if multibyte is off'
+  else
+    : ${(#X):-0x80}
+  fi
 1:${(#X)...}: out-of-range character
-?(eval):1: character not in range
+?(eval):4: character not in range
 
   [[ ${(#):-0x80} = $'\x80' ]] && echo OK
 0:${(#)...}: out-of-range character
 >OK
 
   a=( 0x80 0x81 )
-  : ${(#X)a}
-1:${(#X)...}: array of out-of-range characters
-?(eval):2: character not in range
-
   printf "%s\n" ${(#)a} |
   while read x; do echo $(( #x )); done
 0:${(#)...}: array of out-of-range characters
 >128
 >129
+
+  if [[ ! -o multibyte ]]; then
+    ZTST_skip='(#X) accepts any byte if multibyte is off'
+  else
+    : ${(#X)a}
+  fi
+1:${(#X)...}: array of out-of-range characters
+?(eval):4: character not in range




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

end of thread, other threads:[~2023-09-26 17:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-23 15:52 Test "failure" on multibyte conversions Bart Schaefer
2023-09-24  2:10 ` Jun. T
2023-09-24 14:00   ` Bart Schaefer
2023-09-26 17:13     ` Jun. T

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).