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

Re: Test ./E03posix.ztst was expected to fail, but passed.



> 2022/03/16 1:53, Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> 
> On 3/15/22, Vincent Lefevre <vincent@xxxxxxxxxx> wrote:
>> 
>> Test ./E03posix.ztst was expected to fail, but passed.
>> Was testing: Width of %s is computed in bytes not characters
>> ./E03posix.ztst: test XPassed.
(snip)
>> I don't know the current status... Has this been discussed in the
>> austin-group list?
(snip)
> Noticed and discussed a bit on IRC the other week/month (sorry for
> unedited irc log)
(snip)
> 19:26 <Mikachu> but my LC_CTYPE is set to that, and LC_ALL is unset


Please try the following patch.

The patch for E03posix.ztst may not be necessary for fixing the
current problem, but I think it is always safer to use 'zsh -f'.


diff --git a/Test/E03posix.ztst b/Test/E03posix.ztst
index b191199ad..9695777f6 100644
--- a/Test/E03posix.ztst
+++ b/Test/E03posix.ztst
@@ -125,39 +125,39 @@
 F:POSIX requires a solitary "-" to be a plain argument
 >-
 
-  ARGV0=sh $ZTST_testdir/../Src/zsh -c 'foreach() { true; }'
+  ARGV0=sh $ZTST_testdir/../Src/zsh -fc 'foreach() { true; }'
 -f:"foreach" is not a reserved word
 
-  ARGV0=sh $ZTST_testdir/../Src/zsh -c 'end() { true; }
+  ARGV0=sh $ZTST_testdir/../Src/zsh -fc 'end() { true; }
 -f:"end" is not a reserved word
 
-  a='a:b:' ARGV0=sh $ZTST_testdir/../Src/zsh -c 'IFS=:; printf "<%s>\n" $a'
+  a='a:b:' ARGV0=sh $ZTST_testdir/../Src/zsh -fc 'IFS=:; printf "<%s>\n" $a'
 0f:IFS is a separator, not a delimiter
 ><a>
 ><b>
 
-  a=$'\ra\r\rb' ARGV0=sh $ZTST_testdir/../Src/zsh -c 'IFS=:; printf "<%s>\n" $a'
+  a=$'\ra\r\rb' ARGV0=sh $ZTST_testdir/../Src/zsh -fc 'IFS=:; printf "<%s>\n" $a'
 0f:All whitespace characters are "IFS whitespace"
 F:isspace('\r') is true so \r should behave like space, \t, \n
 F:This may also need to apply to multibyte whitespace
 ><a>
 ><b>
 
-  ARGV0=sh $ZTST_testdir/../Src/zsh -c 'IFS=2; printf "<%s>\n" $((11*11))'
+  ARGV0=sh $ZTST_testdir/../Src/zsh -fc 'IFS=2; printf "<%s>\n" $((11*11))'
 0f:IFS applies to math results (numbers treated as strings)
 ><1>
 ><1>
 
-  ARGV0=sh $ZTST_testdir/../Src/zsh -c 'inf=42; echo $((inf))'
+  ARGV0=sh $ZTST_testdir/../Src/zsh -fc 'inf=42; echo $((inf))'
 0:All identifiers are variable references in POSIX arithmetic
 F:POSIX has neither math functions nor floating point
 >42
 
-  ARGV0=sh $ZTST_testdir/../Src/zsh -c 'EUID=10; echo "$EUID"'
+  ARGV0=sh $ZTST_testdir/../Src/zsh -fc 'EUID=10; echo "$EUID"'
 -f:EUID is not a special variable
 >10
 
-  ARGV0=sh $ZTST_testdir/../Src/zsh -c "printf '<%10s>\n' St$'\M-C\M-)'phane"
+  ARGV0=sh $ZTST_testdir/../Src/zsh -fc "printf '<%10s>\n' St$'\M-C\M-)'phane"
 0f:Width of %s is computed in bytes not characters
 F:This is considered a bugfix in zsh
 ><  Stéphane>
diff --git a/Test/ztst.zsh b/Test/ztst.zsh
index a59c06dcf..43f8ed730 100755
--- a/Test/ztst.zsh
+++ b/Test/ztst.zsh
@@ -25,6 +25,7 @@ emulate -R zsh
 # Ensure the locale does not screw up sorting.  Don't supply a locale
 # unless there's one set, to minimise problems.
 [[ -n $LC_ALL ]] && LC_ALL=C
+[[ -n $LC_CTYPE ]] && LC_CTYPE=C
 [[ -n $LC_COLLATE ]] && LC_COLLATE=C
 [[ -n $LC_NUMERIC ]] && LC_NUMERIC=C
 [[ -n $LC_MESSAGES ]] && LC_MESSAGES=C








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