1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-02-10 17:31:56 +02:00

tests: fold: avoid false failures on Solaris 10

* tests/fold/fold-characters.sh: Ensure we have independent verification
of the width of characters before testing based on those widths.
* tests/fold/fold-zero-width.sh: Likewise.
* tests/fold/fold.pl: Only compare the exit status,
as the error message can be translated.
This commit is contained in:
Pádraig Brady
2025-09-20 17:10:30 +01:00
parent df30ce36e8
commit 70eb250fd7
3 changed files with 8 additions and 3 deletions

View File

@@ -25,6 +25,9 @@ test "$LOCALE_FR_UTF8" != none || skip_ "French UTF-8 locale not available"
LC_ALL=$LOCALE_FR_UTF8
export LC_ALL
test $(env printf '\uB250\uFF1A' | wc -L) -eq 4 ||
skip_ "character width mismatch"
# The string "뉐뉐뉐" is 3 characters, but occupies 6 columns.
env printf '\uB250\uB250\uB250\n' > input1 || framework_failure_
env printf '\uB250\uB250\n\uB250\n' > column-exp1 || framework_failure_

View File

@@ -36,6 +36,9 @@ test "$LOCALE_FR_UTF8" != none || skip_ "French UTF-8 locale not available"
LC_ALL=$LOCALE_FR_UTF8
export LC_ALL
test $(env printf '\u200B' | wc -L) -eq 0 ||
skip_ "character width mismatch"
# Same thing, but using U+200B ZERO WIDTH SPACE.
yes $(env printf '\u200B') |
head -n $IO_BUFSIZE_TIMES2 | tr -d '\n' > inp || framework_failure_

View File

@@ -40,10 +40,9 @@ my @Tests =
# The downstream I18N patch made fold(1) exit with success for non-existing
# files since v5.2.1-1158-g3d3030da6 (2004) changed int to bool for booleans.
# The I18N patch was fixed only in July 2024. (rhbz#2296201).
['enoent', 'enoent', {EXIT => 1},
{ERR=>"$prog: enoent: No such file or directory\n"}],
['enoent', 'enoent', {EXIT => 1}, {ERR_SUBST=>"s/.*//msg"}],
# The downstream I18N patch made 'fold -b' mishandled '\n' in UTF locales.
# The downstream I18N patch made 'fold -b' mishandle '\n' in UTF locales.
# The I18N patch was fixed only in Sep 2024. (RHEL-60295)
['bw1', '-b -w 4', {IN=>"abcdef\nghijkl"}, {OUT=>"abcd\nef\nghij\nkl"}],
['bw2', '-b -w 6', {IN=>"1234567890\nabcdefghij\n1234567890"},