]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: fold: avoid false failures on Solaris 10
authorPádraig Brady <P@draigBrady.com>
Sat, 20 Sep 2025 16:10:30 +0000 (17:10 +0100)
committerPádraig Brady <P@draigBrady.com>
Sat, 20 Sep 2025 21:12:58 +0000 (22:12 +0100)
* 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.

tests/fold/fold-characters.sh
tests/fold/fold-zero-width.sh
tests/fold/fold.pl

index 8be54061bde1d1093e45b18e57a0b771292661c3..5c72c9e97027e1978d0c57a6449fdec1392916cc 100755 (executable)
@@ -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_
index b876473c752a89f43b13fd880b565eefc30365c5..04cbe4afd6caad4e9965fa1ab645256e52be3a13 100755 (executable)
@@ -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_
index ea9bc5c6af4cac210b15e61614e8d78921e29bc3..c4c14e2fdb897f280472f4bf13da799ece702cd1 100755 (executable)
@@ -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"},