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

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



On 3/15/22, Vincent Lefevre <vincent@xxxxxxxxxx> wrote:
> With the git repository on Debian/unstable:
>
> [...]
> ./E03posix.ztst: starting.
> Test ./E03posix.ztst was expected to fail, but passed.
> Was testing: Width of %s is computed in bytes not characters
> ./E03posix.ztst: test XPassed.
> The following may (or may not) help identifying the cause:
>   This is considered a bugfix in zsh
> [...]
> **************************************
> 60 successful test scripts, 1 failure, 3 skipped
> **************************************
>
> I don't know the current status... Has this been discussed in the
> austin-group list?
>
> Note that "wc" has 2 versions (-c for characters, -m for bytes)
> because each of them may be useful. I would expect something
> similar for "printf".

Noticed and discussed a bit on IRC the other week/month (sorry for
unedited irc log)

19:16 <Mikachu> oh speaking of tests, i have this in master
19:16 <Mikachu> Test ./E03posix.ztst was expected to fail, but passed.
19:16 <Mikachu> Was testing: Width of %s is computed in bytes not characters
19:16 <Mikachu> ./E03posix.ztst: test XPassed.
19:16 <Mikachu> The following may (or may not) help identifying the cause:
19:16 <Mikachu>   This is considered a bugfix in zsh
19:16 <Mikachu> was this fixed and someone forgot to remove xfail?
19:16 <Mikachu> or is my system magical
19:19 <danielsh> not sure
19:20 <danielsh> what does bin_printf do with 's'?
19:24 <Mikachu> also not sure
19:24 <Mikachu> if i replace two characters with a single ま it
misaligns for me though so no idea what's going on
19:24 <Mikachu> (3 bytes, 2 cells wide)
19:24 <danielsh> one more thing
19:24 <danielsh> I tried the printf manually, outside the test suite
19:25 <danielsh> prints the expected result
19:25 <danielsh> I run the test.  passes.  (= failed as expected)
19:25 <Mikachu> does it fail as expected in the suite for you
19:25 <Mikachu> ah
19:25 <Mikachu> maybe it only sets specific LC vars
19:26 <Mikachu> with LC_ALL=C it works
19:26 <Mikachu> but also wouldn't consider it a bug in this case
19:26 <Mikachu> hmm, also with LC_ALL=sv_SE.UTF-8
19:26 <Mikachu> but my LC_CTYPE is set to that, and LC_ALL is unset
19:26 <Mikachu> confusion
19:26 <danielsh> LC_ALL=C gives me a single space.  which is reasonable
19:27 <Mikachu> oh these are explicitly run with sh emulation too
19:27 <danielsh> the tests run force some locales but not others
19:28 <danielsh> oh forgot that
19:28 <danielsh> still produces expected output interactively
19:28 <danielsh> try running 'locale' in the test and removing the 'f'
flag so we see what locale it runs as ?
19:29 <Mikachu> i'm very confused by this test, when i edit the
command, it doesn't change the result of the test, but if i remove the
whole line it complains about a syntax error, so i AM editing the
right file...
19:29 <danielsh> the test has the 'f' flag
19:29 <Mikachu> oh right
19:30 <Mikachu> it has my locale except LANG=C which is irrelevant
19:31 <danielsh> my locale is C.UTF-8 (mostly) and I get plain C instead
19:31 <danielsh> I wonder if the test should move to D07multibyte
19:32 <danielsh> yeah it passes in D07 without f
19:33 <Mikachu> still fails with a doublewidth japanese char though
19:33 <Mikachu> very strange...
19:34 <Mikachu> anyway, i guess it's not an urgent issue then
19:35 <danielsh> with \'e and Japanese I get three spaces
19:35 <danielsh> but in the test and interactively
19:35 <danielsh> should still move the test though?
19:35 <danielsh> or figure what sets the locale to C
19:36 <danielsh> oh fun ztst.zsh:27-31
19:38 <Mikachu> i don't get why i get different results when LANG is
set to C, LANG isn't used since all my LC_* vars are set
19:38 <danielsh> in D07 ?
19:39 <danielsh> or in E03 ?
19:39 <Mikachu> in E03
19:40 <danielsh> so with LANG=C it fails as expected and with LANG
unset it xpasses, right ?
19:41 <Mikachu> well, the only difference i could spot in the locale
output was LANG, i didn't try unsetting it to see if that affected
it...
19:41 <phy1729> Seems more consistent to  unset $parameters[(I)LC_*]
19:41 <danielsh> the modload may not be available
19:41 <Mikachu> LANG *should* have no effect
19:41 <danielsh> you remember that 'locale' output uses "" specially ?
19:41 <Mikachu> just set LC_ALL
19:41 <Mikachu> yeah
19:41 <phy1729> It's loaded on L44
19:42 <danielsh> L44 of?
19:42 <phy1729> Test/ztst.zsh
19:42 <danielsh> line 43 is wrong though
19:42 <danielsh> you would know :)
19:43 <phy1729> Yes but if no one has complained yet that
zsh/parameter is required, I say keep it :)
19:44 <danielsh> but how will we port zsh to abacuses?
19:44 <Mikachu> we can port zsh to other systems without requiring the
full test suite to be available


-- 
Mikael Magnusson




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