fix sort-mb-tests.sh test (B.Voelker)
This commit is contained in:
parent
970e32111e
commit
1812652505
@ -4119,68 +4119,50 @@ diff -urNp coreutils-8.21-orig/tests/misc/mb2.X coreutils-8.21/tests/misc/mb2.X
|
|||||||
+Banana@AA5@@30
|
+Banana@AA5@@30
|
||||||
diff -urNp coreutils-8.21-orig/tests/misc/sort-mb-tests.sh coreutils-8.21/tests/misc/sort-mb-tests.sh
|
diff -urNp coreutils-8.21-orig/tests/misc/sort-mb-tests.sh coreutils-8.21/tests/misc/sort-mb-tests.sh
|
||||||
--- coreutils-8.21-orig/tests/misc/sort-mb-tests.sh 1970-01-01 01:00:00.000000000 +0100
|
--- coreutils-8.21-orig/tests/misc/sort-mb-tests.sh 1970-01-01 01:00:00.000000000 +0100
|
||||||
+++ coreutils-8.21/tests/misc/sort-mb-tests.sh 2013-02-15 14:25:08.020467562 +0100
|
+++ coreutils-8.21/tests/misc/sort-mb-tests.sh 2013-02-18 17:44:03.852275681 +0100
|
||||||
@@ -0,0 +1,63 @@
|
@@ -0,0 +1,45 @@
|
||||||
+#! /bin/sh
|
+#!/bin/sh
|
||||||
|
+# Verify sort's multi-byte support.
|
||||||
+
|
+
|
||||||
+. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
|
+. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
|
||||||
+
|
+print_ver_ sort
|
||||||
+expensive_
|
|
||||||
+
|
|
||||||
+case $# in
|
|
||||||
+ 0) xx='../src/sort';;
|
|
||||||
+ *) xx="$1";;
|
|
||||||
+esac
|
|
||||||
+test "$VERBOSE" && echo=echo || echo=:
|
|
||||||
+$echo testing program: $xx
|
|
||||||
+errors=0
|
|
||||||
+test "$srcdir" || srcdir=.
|
|
||||||
+test "$VERBOSE" && $xx --version 2> /dev/null
|
|
||||||
+
|
+
|
||||||
+export LC_ALL=en_US.UTF-8
|
+export LC_ALL=en_US.UTF-8
|
||||||
+locale -k LC_CTYPE 2>&1 | grep -q charmap.*UTF-8 || exit 77
|
+locale -k LC_CTYPE | grep -q "charmap.*UTF-8" \
|
||||||
+errors=0
|
+ || skip_ "No UTF-8 locale available"
|
||||||
+
|
+
|
||||||
+$xx -t @ -k2 -n misc/mb1.I > misc/mb1.O
|
|
||||||
+code=$?
|
|
||||||
+if test $code != 0; then
|
|
||||||
+ $echo "Test mb1 failed: $xx return code $code differs from expected value 0"
|
|
||||||
+ errors=`expr $errors + 1`
|
|
||||||
+else
|
|
||||||
+ cmp misc/mb1.O $srcdir/misc/mb1.X > /dev/null 2>&1
|
|
||||||
+ case $? in
|
|
||||||
+ 0) if test "$VERBOSE"; then $echo "passed mb1"; fi;;
|
|
||||||
+ 1) $echo "Test mb1 failed: files misc/mb1.O and $srcdir/misc/mb1.X differ" 1>&2
|
|
||||||
+ (diff -c misc/mb1.O $srcdir/misc/mb1.X) 2> /dev/null
|
|
||||||
+ errors=`expr $errors + 1`;;
|
|
||||||
+ 2) $echo "Test mb1 may have failed." 1>&2
|
|
||||||
+ $echo The command "cmp misc/mb1.O $srcdir/misc/mb1.X" failed. 1>&2
|
|
||||||
+ errors=`expr $errors + 1`;;
|
|
||||||
+ esac
|
|
||||||
+fi
|
|
||||||
+
|
+
|
||||||
+$xx -t @ -k4 -n misc/mb2.I > misc/mb2.O
|
+cat <<EOF > exp
|
||||||
+code=$?
|
+Banana@5
|
||||||
+if test $code != 0; then
|
+Apple@10
|
||||||
+ $echo "Test mb2 failed: $xx return code $code differs from expected value 0" 1>&2
|
+Citrus@20
|
||||||
+ errors=`expr $errors + 1`
|
+Cherry@30
|
||||||
+else
|
+EOF
|
||||||
+ cmp misc/mb2.O $srcdir/misc/mb2.X > /dev/null 2>&1
|
|
||||||
+ case $? in
|
|
||||||
+ 0) if test "$VERBOSE"; then $echo "passed mb2"; fi;;
|
|
||||||
+ 1) $echo "Test mb2 failed: files misc/mb2.O and $srcdir/misc/mb2.X differ" 1>&2
|
|
||||||
+ (diff -c misc/mb2.O $srcdir/misc/mb2.X) 2> /dev/null
|
|
||||||
+ errors=`expr $errors + 1`;;
|
|
||||||
+ 2) $echo "Test mb2 may have failed." 1>&2
|
|
||||||
+ $echo The command "cmp misc/mb2.O $srcdir/misc/mb2.X" failed. 1>&2
|
|
||||||
+ errors=`expr $errors + 1`;;
|
|
||||||
+ esac
|
|
||||||
+fi
|
|
||||||
+
|
+
|
||||||
+if test $errors = 0; then
|
+cat <<EOF | sort -t @ -k2 -n > out || fail=1
|
||||||
+ $echo Passed all 113 tests. 1>&2
|
+Apple@10
|
||||||
+else
|
+Banana@5
|
||||||
+ $echo Failed $errors tests. 1>&2
|
+Citrus@20
|
||||||
+fi
|
+Cherry@30
|
||||||
+test $errors = 0 || errors=1
|
+EOF
|
||||||
+exit $errors
|
+
|
||||||
|
+compare exp out || { fail=1; cat out; }
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+cat <<EOF > exp
|
||||||
|
+Citrus@AA20@@5
|
||||||
|
+Cherry@AA30@@10
|
||||||
|
+Apple@AA10@@20
|
||||||
|
+Banana@AA5@@30
|
||||||
|
+EOF
|
||||||
|
+
|
||||||
|
+cat <<EOF | sort -t @ -k4 -n > out || fail=1
|
||||||
|
+Apple@AA10@@20
|
||||||
|
+Banana@AA5@@30
|
||||||
|
+Citrus@AA20@@5
|
||||||
|
+Cherry@AA30@@10
|
||||||
|
+EOF
|
||||||
|
+
|
||||||
|
+compare exp out || { fail=1; cat out; }
|
||||||
|
+
|
||||||
|
+Exit $fail
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
Summary: A set of basic GNU tools commonly used in shell scripts
|
Summary: A set of basic GNU tools commonly used in shell scripts
|
||||||
Name: coreutils
|
Name: coreutils
|
||||||
Version: 8.21
|
Version: 8.21
|
||||||
Release: 3%{?dist}
|
Release: 4%{?dist}
|
||||||
License: GPLv3+
|
License: GPLv3+
|
||||||
Group: System Environment/Base
|
Group: System Environment/Base
|
||||||
Url: http://www.gnu.org/software/coreutils/
|
Url: http://www.gnu.org/software/coreutils/
|
||||||
@ -376,6 +376,9 @@ fi
|
|||||||
%{_sbindir}/chroot
|
%{_sbindir}/chroot
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Feb 18 2013 Ondrej Oprala <ooprala@redhat.com> 8.21-4
|
||||||
|
- fix sort-mb-tests.sh test (B.Voelker)
|
||||||
|
|
||||||
* Mon Feb 18 2013 Mark Wielaard <mjw@redhat.com> 8.21-3
|
* Mon Feb 18 2013 Mark Wielaard <mjw@redhat.com> 8.21-3
|
||||||
- fix coreutils-i18n.patch to terminate mbdelim string (#911929)
|
- fix coreutils-i18n.patch to terminate mbdelim string (#911929)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user