]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: fix false failure on OS X
authorPádraig Brady <P@draigBrady.com>
Tue, 15 Nov 2016 21:27:31 +0000 (21:27 +0000)
committerPádraig Brady <P@draigBrady.com>
Tue, 15 Nov 2016 21:29:10 +0000 (21:29 +0000)
* tests/misc/sort-h-thousands-sep.sh: The sv_SE locale
may be available while sv_SE.utf8 is not.  Therefore
test and use the same locale, now definfed in a variable.
Reported by Jim Meyering.

tests/misc/sort-h-thousands-sep.sh

index 3ffa89eeb24ad4f0e8589cf24f1eb3bce7c419d6..f14927ca2951331594e749398ec5bc96e0d432af 100755 (executable)
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
 print_ver_ sort
 
-test "$(LC_ALL=sv_SE locale thousands_sep)" = ' ' \
-  || skip_ 'The Swedish locale with blank thousands separator is unavailable.'
+TEST_LOCALE='sv_SE'
+
+test "$(LC_ALL="$TEST_LOCALE" locale thousands_sep)" = ' ' ||
+  skip_ 'The Swedish locale with blank thousands separator is unavailable.'
 
 tee exp1 exp3 > in << _EOF_
 1       1k      1 M     4 003   1M
@@ -41,7 +43,7 @@ cat > exp5 << _EOF_
 _EOF_
 
 for i in 1 2 3 5; do
-  LC_ALL="sv_SE.utf8" sort -h -k $i "in" > "out${i}" || fail=1
+  LC_ALL="$TEST_LOCALE" sort -h -k $i "in" > "out${i}" || fail=1
   compare "exp${i}" "out${i}" || fail=1
 done