X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-exclude8.sh;h=9cbdbac774abacc7b4fbceea86084101d6a81421;hb=54c3ba61dfdf260865f2a6529ab414e24da17cf5;hp=ee14bbcd8f9d2fc7899afee64b1c8cc2cabee314;hpb=abe9c758009394a09d0cb84cdaae37e5752953f2;p=gnulib.git diff --git a/tests/test-exclude8.sh b/tests/test-exclude8.sh index ee14bbcd8..9cbdbac77 100755 --- a/tests/test-exclude8.sh +++ b/tests/test-exclude8.sh @@ -1,6 +1,6 @@ #! /bin/sh # Test suite for exclude. -# Copyright (C) 2010 Free Software Foundation, Inc. +# Copyright (C) 2010-2013 Free Software Foundation, Inc. # This file is part of the GNUlib Library. # # This program is free software: you can redistribute it and/or modify @@ -16,25 +16,31 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -TMP=excltmp.$$ -LIST=flist.$$ -ERR=0 +. "${srcdir=.}/init.sh"; path_prepend_ . +fail=0 # Test escaped metacharacters. -cat > $LIST <<'EOT' +cat > in <<'EOT' f\*e b[a\*]r EOT -cat > $TMP <<'EOT' +cat > expected <<'EOT' f*e: 1 file: 0 bar: 1 EOT -./test-exclude$EXEEXT -wildcards $LIST -- 'f*e' 'file' 'bar' | - tr -d '\015' | diff -c $TMP - || ERR=1 +test-exclude -wildcards in -- 'f*e' 'file' 'bar' > out || exit $? -rm -f $TMP $LIST -exit $ERR +# Find out how to remove carriage returns from output. Solaris /usr/ucb/tr +# does not understand '\r'. +case $(echo r | tr -d '\r') in '') cr='\015';; *) cr='\r';; esac + +# normalize output +LC_ALL=C tr -d "$cr" < out > k && mv k out + +compare expected out || fail=1 + +Exit $fail