tests: avoid false failures on dash 0.5.13

dash 0.5.13 to 0.5.13.5 at least has a variable expansion bug:
https://bugzilla.redhat.com/2568651
This was seen on Fedora 44 and there is no upstream dash
release with a fix yet.

* init.cfg (bad_unicode): Avoid the dash issue, by comparing
the variable expansion and skipping upon mismatch.
* tests/du/block-size.sh: Add explicit checks for expansion
on values with high bit set.
* tests/paste/multi-byte.sh: Likewise.
This commit is contained in:
Pádraig Brady committed 2026-11-08 13:59:08 +00:00
1 parent 25049d6e3e
commit 27e21ce402
3 files changed
+17 -1

No files matched your search

+9 -1
View File
@@ -888,7 +888,15 @@ bad_unicode ()
require_built_ printf
# invalid UTF8|unpaired surrogate|C1 control|noncharacter
env printf '\xFF|\xED\xBA\xAD|\u0089|\xED\xA6\xBF\xED\xBF\xBF\n'
local format='\xFF|\xED\xBA\xAD|\u0089|\xED\xA6\xBF\xED\xBF\xBF\n'
local bytes
# dash 0.5.13 can corrupt non ASCII during variable assignment.
bytes=$(env printf "$format")
if test "$bytes" != "$(env printf "$format")"; then
warn_ 'shell cannot preserve invalid Unicode bytes; using ASCII instead'
bytes='not_bad_unicode'
fi
printf '%s\n' "$bytes"
}
# AIX has a 'strace' program unrelated to the one we care about. Avoid
+3
View File
@@ -60,6 +60,9 @@ test_unit ()
{ test -z "$loc" || test "$loc" = none; } && continue
if test $loc != C; then
thousands_sep=$(LC_ALL=$loc locale thousands_sep)
# dash 0.5.13 corrupts non-ASCII bytes during variable assignment.
test "$thousands_sep" = "$(LC_ALL=$loc locale thousands_sep)" ||
skip_ 'shell cannot preserve locale thousands separator'
grouping=$(LC_ALL=$loc locale grouping)
test -z "$thousands_sep" && continue
test "$grouping" != 3 && continue
+5
View File
@@ -32,6 +32,11 @@ delim_euro=$(env printf '\xe2\x82\xac')
# UTF-8 test: 4-byte character (e.g., emoji: U+1F600)
delim_emoji=$(env printf '\xf0\x9f\x98\x80')
# dash 0.5.13 corrupts UTF-8 bytes during variable assignment.
test "$delim_cent$delim_euro$delim_emoji" = \
"$(env printf '\xc2\xa2\xe2\x82\xac\xf0\x9f\x98\x80')" ||
skip_ 'shell cannot preserve UTF-8 delimiters'
printf '1\n2\n' > f1 || framework_failure_
printf 'a\nb\n' > f2 || framework_failure_