1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

tests/locale.sh: skip SJIS test on non-SJIS locale (re: c2cb0eae)

On Fedora, this regression test failure occurs:

	locale.sh[84]: 'read' doesn't skip multibyte input
				correctly (ja_JP.ujis, \x95\x5c)

This is a problem with the test; this Shift-JIS specific test
should not be run in a non-Shift-JIS locale. So this commit skips
it unless the locale string ends in '.SJIS' (case insensitive).

It also adds cleanup for the 'chr' variable's special attributes
in case that name is ever going to be used in another test.
This commit is contained in:
Martijn Dekker 2021-05-11 18:59:38 +02:00
parent aa601a397d
commit bf76268d24

View file

@ -81,10 +81,11 @@ do [[ $locale == *[Jj][Ii][Ss] ]] || continue
# dangling final backslash (which is invalid) and return a nonzero exit status.
# Note that the byte sequence '\x95\x5c' represents a multibyte character U+8868,
# whereas '\x5c' is a backslash when interpreted as a single-byte character.
[[ $locale == *.[Ss][Jj][Ii][Ss] ]] || continue
printf "\x95\x$c\n" | read x || err_exit "'read' doesn't skip multibyte input correctly ($LC_ALL, \x95\x$c)"
done
done
unset LC_ALL
unset LC_ALL chr
# Test the effect of setting a locale, followed by setting a different locale
# then setting the previous locale. The output from 'printf %T' should use