diff options
Diffstat (limited to 'tests/misc')
35 files changed, 67 insertions, 67 deletions
diff --git a/tests/misc/arch b/tests/misc/arch index 194f7f359..df45e4a19 100755 --- a/tests/misc/arch +++ b/tests/misc/arch @@ -24,6 +24,6 @@ require_built_ arch arch > out || fail=1 uname -m > exp || fail=1 -compare out exp || fail=1 +compare exp out || fail=1 Exit $fail diff --git a/tests/misc/cat-buf b/tests/misc/cat-buf index 348b41450..4bb5419b8 100755 --- a/tests/misc/cat-buf +++ b/tests/misc/cat-buf @@ -36,7 +36,7 @@ cat_buf_1() dd count=1 if=fifo > out & (echo 1; sleep $delay; echo 2) | cat -v > fifo wait # for dd to complete - compare out exp + compare exp out } retry_delay_ cat_buf_1 .1 6 || fail=1 diff --git a/tests/misc/cat-proc b/tests/misc/cat-proc index 83c173513..2372980c3 100755 --- a/tests/misc/cat-proc +++ b/tests/misc/cat-proc @@ -33,6 +33,6 @@ test -f $f \ cat -E $f | sed 's/[0-9][0-9]*/D/g' | tr -d '$' > out || fail=1 cat $f | sed 's/[0-9][0-9]*/D/g' | tr -d '$' > exp || fail=1 -compare out exp || fail=1 +compare exp out || fail=1 Exit $fail diff --git a/tests/misc/chcon b/tests/misc/chcon index 0f367ef89..70837af6c 100755 --- a/tests/misc/chcon +++ b/tests/misc/chcon @@ -68,10 +68,10 @@ f|-robject_r|root:object_r:file_t:$range f|-ttmp_t|root:object_r:tmp_t:$range EOF -compare out exp || fail=1 +compare exp out || fail=1 chcon --verbose -u$u1 f > out || fail=1 echo 'changing security context of `f'\' > exp -compare out exp || fail=1 +compare exp out || fail=1 Exit $fail diff --git a/tests/misc/csplit b/tests/misc/csplit index 652690c5e..7536bbb39 100755 --- a/tests/misc/csplit +++ b/tests/misc/csplit @@ -28,14 +28,14 @@ cat <<EOF > exp 0 2 EOF -compare out exp || fail=1 +compare exp out || fail=1 rm -f in out exp # Ensure that xx02 contains just two newlines. # This would fail due to reading from freed buffer with coreutils-5.0.91. printf '\n\n' > exp cp xx02 out || fail=1 -compare out exp || fail=1 +compare exp out || fail=1 rm -f in out exp # csplit would infloop @@ -45,7 +45,7 @@ cat <<EOF > exp 0 3 EOF -compare out exp || fail=1 +compare exp out || fail=1 rm -f in out exp # `echo |csplit - 1 1' used to abort. @@ -56,11 +56,11 @@ cat <<EOF > exp 0 1 EOF -compare out exp || fail=1 +compare exp out || fail=1 cat <<\EOF > experr csplit: warning: line number `1' is the same as preceding line number EOF -compare err experr || fail=1 +compare experr err || fail=1 rm -f in out exp err experr # `echo | csplit -b '%0#6.3x' - 1' incorrectly warned about the format @@ -71,9 +71,9 @@ cat <<EOF > exp 0 1 EOF -compare out exp || fail=1 +compare exp out || fail=1 touch experr -compare err experr || fail=1 +compare experr err || fail=1 compare 'xx 000' experr || fail=1 compare 'xx 0x001' in || fail=1 rm -f in out exp err experr xx* @@ -89,7 +89,7 @@ csplit: line number `1' is smaller than preceding line number, 2 csplit: warning: line number `3' is the same as preceding line number csplit: `3': line number out of range EOF -compare err experr || fail=1 +compare experr err || fail=1 # Ensure that lines longer than the initial buffer length don't cause # trouble (e.g. reading from freed memory, resulting in corrupt output). diff --git a/tests/misc/df-P b/tests/misc/df-P index c55c8c1d4..042abb5ec 100755 --- a/tests/misc/df-P +++ b/tests/misc/df-P @@ -32,6 +32,6 @@ BLOCK_SIZE=1M df -P . > t2 || fail=1 head -n1 t1 > exp || fail=1 head -n1 t2 > out || fail=1 -compare out exp || fail=1 +compare exp out || fail=1 Exit $fail diff --git a/tests/misc/fmt-long-line b/tests/misc/fmt-long-line index 4d424c095..cf1356bf8 100755 --- a/tests/misc/fmt-long-line +++ b/tests/misc/fmt-long-line @@ -56,6 +56,6 @@ EOF fmt -s in > out || fail=1 -compare out exp || fail=1 +compare exp out || fail=1 Exit $fail diff --git a/tests/misc/groups-dash b/tests/misc/groups-dash index 711d452e7..b6cf873bd 100755 --- a/tests/misc/groups-dash +++ b/tests/misc/groups-dash @@ -27,6 +27,6 @@ echo $? >> out groups -- none -- > exp 2>&1 && fail=1 echo $? >> exp -compare out exp || fail=1 +compare exp out || fail=1 Exit $fail diff --git a/tests/misc/groups-version b/tests/misc/groups-version index f086a74e7..e1ca78ccd 100755 --- a/tests/misc/groups-version +++ b/tests/misc/groups-version @@ -23,6 +23,6 @@ require_built_ groups groups --version | sed 's/^groups/id/; /^$/q' > out || fail=1 id --version | sed '/^$/q' > exp || fail=1 -compare out exp || fail=1 +compare exp out || fail=1 Exit $fail diff --git a/tests/misc/head-pos b/tests/misc/head-pos index 79e2a43e0..a8bfe2f86 100755 --- a/tests/misc/head-pos +++ b/tests/misc/head-pos @@ -27,6 +27,6 @@ cat <<EOF > exp b EOF -compare out exp || fail=1 +compare exp out || fail=1 Exit $fail diff --git a/tests/misc/nl b/tests/misc/nl index 05270c8d7..4eef6f867 100755 --- a/tests/misc/nl +++ b/tests/misc/nl @@ -38,6 +38,6 @@ cat <<\EOF > exp $ EOF -compare out exp || fail=1 +compare exp out || fail=1 Exit $fail diff --git a/tests/misc/od-N b/tests/misc/od-N index 2aa210674..17c11aec5 100755 --- a/tests/misc/od-N +++ b/tests/misc/od-N @@ -27,6 +27,6 @@ cat <<EOF > exp || fail=1 a b c d e f EOF -compare out exp || fail=1 +compare exp out || fail=1 Exit $fail diff --git a/tests/misc/od-multiple-t b/tests/misc/od-multiple-t index 4f8698768..edcb5d9ae 100755 --- a/tests/misc/od-multiple-t +++ b/tests/misc/od-multiple-t @@ -37,6 +37,6 @@ for format1 in $list; do done done -compare out exp || fail=1 +compare exp out || fail=1 Exit $fail diff --git a/tests/misc/od-x8 b/tests/misc/od-x8 index b66269faf..2cbe5c34e 100755 --- a/tests/misc/od-x8 +++ b/tests/misc/od-x8 @@ -38,6 +38,6 @@ od -An -t x1 in \ | sort -n \ > exp -compare out exp || fail=1 +compare exp out || fail=1 Exit $fail diff --git a/tests/misc/printf b/tests/misc/printf index b9092e17f..276541968 100755 --- a/tests/misc/printf +++ b/tests/misc/printf @@ -34,7 +34,7 @@ cat <<\EOF > exp foo EOF -compare out exp || fail=1 +compare exp out || fail=1 rm -f out exp # Until coreutils-4.5.10, this would elicit a segfault. @@ -94,7 +94,7 @@ cat <<\EOF > exp 11 x EOF -compare out exp || fail=1 +compare exp out || fail=1 # Verify handling of single quote chars (\' or \") @@ -121,7 +121,7 @@ printf: ": expected a numeric value printf: a: expected a numeric value EOF -compare out exp || fail=1 -compare err exp_err || fail=1 +compare exp out || fail=1 +compare exp_err err || fail=1 Exit $fail diff --git a/tests/misc/printf-hex b/tests/misc/printf-hex index 106490ece..000f7b17f 100755 --- a/tests/misc/printf-hex +++ b/tests/misc/printf-hex @@ -24,6 +24,6 @@ cat <<\EOF > exp ~3 EOF -compare out exp || fail=1 +compare exp out || fail=1 Exit $fail diff --git a/tests/misc/pwd-option b/tests/misc/pwd-option index 708401ff2..e51a0ae6e 100755 --- a/tests/misc/pwd-option +++ b/tests/misc/pwd-option @@ -57,6 +57,6 @@ printf %s\\n "$base/a/b" >> exp || fail=1 env -- PWD="$base/a/../c" pwd -L >> out || fail=1 printf %s\\n "$base/a/b" >> exp || fail=1 -compare out exp || fail=1 +compare exp out || fail=1 Exit $fail diff --git a/tests/misc/readlink-fp-loop b/tests/misc/readlink-fp-loop index 1c50d6a4f..58bfde100 100755 --- a/tests/misc/readlink-fp-loop +++ b/tests/misc/readlink-fp-loop @@ -35,7 +35,7 @@ ln -s ../s/2 d/1 || framework_failure_ readlink -v -e p/1 > out || fail=1 # readlink -e d/2 > exp || fail=1 echo "$cwd/d/2" > exp || fail=1 -compare out exp || fail=1 +compare exp out || fail=1 # Construct a real loop and make sure readlink still detects it. ln -sf ../s/1 d/2 || framework_failure_ @@ -57,12 +57,12 @@ ln -nsf ../p/8 d/7 || framework_failure_ echo x > d/8 || framework_failure_ readlink -v -e p/1 > out || fail=1 echo "$cwd/d/8" > exp || fail=1 -compare out exp || fail=1 +compare exp out || fail=1 # A trivial loop ln -s loop loop readlink -v -e loop 2> out && fail=1 echo "readlink: loop: $symlink_loop_msg" > exp || framework_failure_ -compare out exp || fail=1 +compare exp out || fail=1 Exit $fail diff --git a/tests/misc/runcon-no-reorder b/tests/misc/runcon-no-reorder index 7a4825680..af99e1b50 100755 --- a/tests/misc/runcon-no-reorder +++ b/tests/misc/runcon-no-reorder @@ -37,6 +37,6 @@ case `cat out` in 'runcon: invalid context: '*) echo "$diag" > out;; esac -compare out exp || fail=1 +compare exp out || fail=1 Exit $fail diff --git a/tests/misc/seq-long-double b/tests/misc/seq-long-double index 230912cbe..cdf06ace6 100755 --- a/tests/misc/seq-long-double +++ b/tests/misc/seq-long-double @@ -42,6 +42,6 @@ b=$INTMAX_OFLOW seq $a $b > out || fail=1 printf "$a\n$b\n" > exp || fail=1 -compare out exp || fail=1 +compare exp out || fail=1 Exit $fail diff --git a/tests/misc/sort-NaN-infloop b/tests/misc/sort-NaN-infloop index ead871e43..8075cbb7b 100755 --- a/tests/misc/sort-NaN-infloop +++ b/tests/misc/sort-NaN-infloop @@ -23,6 +23,6 @@ echo nan > F || fail=1 printf 'nan\nnan\n' > exp || fail=1 timeout 10 sort -g -m F F > out || fail=1 -compare out exp || fail=1 +compare exp out || fail=1 Exit $fail diff --git a/tests/misc/sort-benchmark-random b/tests/misc/sort-benchmark-random index 6a61a1462..1baf58788 100755 --- a/tests/misc/sort-benchmark-random +++ b/tests/misc/sort-benchmark-random @@ -48,6 +48,6 @@ close (FILE); time sort in > out || fail=1 -compare out exp || fail=1 +compare exp out || fail=1 Exit $fail diff --git a/tests/misc/sort-debug-keys b/tests/misc/sort-debug-keys index b4c2fb74e..db3a91364 100755 --- a/tests/misc/sort-debug-keys +++ b/tests/misc/sort-debug-keys @@ -284,7 +284,7 @@ printf '\0\ta\n' | sort -s -k2b,2 --debug | tr -d '\0' printf 'A\tchr10\nB\tchr1\n' | sort -s -k2.4b,2.3n --debug ) > out -compare out exp || fail=1 +compare exp out || fail=1 cat <<\EOF > exp 1²---++3 1,234 Mi @@ -324,7 +324,7 @@ if test "$LOCALE_FR_UTF8" != "none"; then sort --debug -k1,1n -k1,1g \ -k1,1h -k2,2n -k2,2g -k2,2h -k3,3n -k3,3g -k3,3h ) > out - compare out exp || fail=1 + compare exp out || fail=1 fi Exit $fail diff --git a/tests/misc/sort-float b/tests/misc/sort-float index 850f57c15..aacd9b3be 100755 --- a/tests/misc/sort-float +++ b/tests/misc/sort-float @@ -88,7 +88,7 @@ $LDBL_MAX tac exp | LC_ALL=$LOC sort -sg > out || fail=1 - compare out exp || fail=1 + compare exp out || fail=1 done Exit $fail diff --git a/tests/misc/sort-merge-fdlimit b/tests/misc/sort-merge-fdlimit index 2de14f4f7..add4bc3a4 100755 --- a/tests/misc/sort-merge-fdlimit +++ b/tests/misc/sort-merge-fdlimit @@ -68,6 +68,6 @@ echo 6 >out || fail=1 ulimit -n 10 && sort -n -m --batch-size=7 -o out out in/1 in/2 in/3 in/4 in/5 out ) && -compare out exp || fail=1 +compare exp out || fail=1 Exit $fail diff --git a/tests/misc/sort-unique-segv b/tests/misc/sort-unique-segv index 6a40c379c..e8e9ecf74 100755 --- a/tests/misc/sort-unique-segv +++ b/tests/misc/sort-unique-segv @@ -43,6 +43,6 @@ EOF sort --parallel=1 -u in > exp || fail=1 sort --parallel=2 -u -S 10b < in > out || fail=1 -compare out exp || fail=1 +compare exp out || fail=1 Exit $fail diff --git a/tests/misc/stat-hyphen b/tests/misc/stat-hyphen index 9a950ba64..c2addcd20 100755 --- a/tests/misc/stat-hyphen +++ b/tests/misc/stat-hyphen @@ -25,6 +25,6 @@ touch f || framework_failure_ stat --format=%n - < f > out || fail=1 stat -f - < f && fail=1 -compare out exp || fail=1 +compare exp out || fail=1 Exit $fail diff --git a/tests/misc/stat-slash b/tests/misc/stat-slash index c317855d6..92dcd47ea 100755 --- a/tests/misc/stat-slash +++ b/tests/misc/stat-slash @@ -39,6 +39,6 @@ stat --format=%F link2 >> out || fail=1 stat -L --format=%F link2 >> out || fail=1 stat --format=%F link2/ >> out || fail=1 -compare out exp || fail=1 +compare exp out || fail=1 Exit $fail diff --git a/tests/misc/stdbuf b/tests/misc/stdbuf index ccf60b197..7a102d383 100755 --- a/tests/misc/stdbuf +++ b/tests/misc/stdbuf @@ -65,7 +65,7 @@ stdbuf_linebuffer() dd count=1 if=fifo > out 2> err & (printf '1\n'; sleep $delay; printf '2\n') | stdbuf -oL uniq > fifo wait # for dd to complete - compare out exp + compare exp out } retry_delay_ stdbuf_linebuffer .1 6 || fail=1 @@ -79,7 +79,7 @@ stdbuf_unbuffer() dd count=1 if=fifo > out 2> err & (printf '1\n'; sleep $delay; printf '2\n') | stdbuf -o0 uniq > fifo wait # for dd to complete - compare out exp + compare exp out } retry_delay_ stdbuf_unbuffer .1 6 || fail=1 @@ -92,7 +92,7 @@ retry_delay_ stdbuf_unbuffer .1 6 || fail=1 # dd count=1 if=fifo > /dev/null 2> err & # printf '1\n\2\n3\n' | (stdbuf -i0 -oL uniq > fifo; cat) > out # wait # for dd to complete - # compare out exp || fail=1 + # compare exp out || fail=1 # One could remove the need for dd (used to close the fifo to get uniq to quit # early), if head -n1 read stdin char by char. Note uniq | head -c2 doesn't # suffice due to the buffering implicit in the pipe. sed currently does read @@ -100,7 +100,7 @@ retry_delay_ stdbuf_unbuffer .1 6 || fail=1 # adding this dependency on a program outside of coreutils. # printf '2\n' > exp # printf '1\n2\n' | (stdbuf -i0 sed 1q >/dev/null; cat) > out - # compare out exp || fail=1 + # compare exp out || fail=1 # Ensure block buffering stdout takes effect # We don't currently test block buffering failures as @@ -113,7 +113,7 @@ retry_delay_ stdbuf_unbuffer .1 6 || fail=1 # dd count=1 if=fifo > out 2> err & # (printf '1\n'; sleep $delay; printf '2\n') | stdbuf -o4 uniq > fifo # wait # for dd to complete - # compare out exp + # compare exp out # } # # retry_delay_ stdbuf_blockbuffer .1 6 || fail=1 diff --git a/tests/misc/sum-sysv b/tests/misc/sum-sysv index f4d6a18ed..19b79ef0f 100755 --- a/tests/misc/sum-sysv +++ b/tests/misc/sum-sysv @@ -35,7 +35,7 @@ $PERL -e '$s = chr(255) x 65537; foreach (1..257) {print $s}' \ cat > exp <<\EOF 65535 32897 EOF -compare out exp || fail=1 +compare exp out || fail=1 rm -f out exp @@ -45,6 +45,6 @@ $PERL -e '$s = chr(255) x 65537; foreach (1..257) {print $s}; print chr(255)' \ cat > exp <<\EOF 254 32897 EOF -compare out exp || fail=1 +compare exp out || fail=1 Exit $fail diff --git a/tests/misc/tac-2-nonseekable b/tests/misc/tac-2-nonseekable index 7b4877367..8ff30dce9 100755 --- a/tests/misc/tac-2-nonseekable +++ b/tests/misc/tac-2-nonseekable @@ -21,7 +21,7 @@ print_ver_ tac echo x | tac - - > out 2> err || fail=1 echo x > exp || fail=1 -compare out exp || fail=1 -compare err /dev/null || fail=1 +compare exp out || fail=1 +compare /dev/null err || fail=1 Exit $fail diff --git a/tests/misc/tac-continue b/tests/misc/tac-continue index 0040ac60a..be6325ce4 100755 --- a/tests/misc/tac-continue +++ b/tests/misc/tac-continue @@ -65,6 +65,6 @@ cat <<\EOF > exp || fail=1 1 EOF -compare out exp || fail=1 +compare exp out || fail=1 Exit $fail diff --git a/tests/misc/tr-case-class b/tests/misc/tr-case-class index 92f1a576c..680f25a11 100755 --- a/tests/misc/tr-case-class +++ b/tests/misc/tr-case-class @@ -23,10 +23,10 @@ print_ver_ tr echo '01234567899999999999999999' > exp echo 'abcdefghijklmnopqrstuvwxyz' | tr '[:lower:]' '0-9' > out || fail=1 -compare out exp || fail=1 +compare exp out || fail=1 echo 'abcdefghijklmnopqrstuvwxyz' | tr '[:lower:][:lower:]' '[:upper:]0-9' > out || fail=1 -compare out exp || fail=1 +compare exp out || fail=1 # Validate the alignment of case classes tr 'A-Z[:lower:]' 'a-y[:upper:]' < /dev/null && fail=1 @@ -44,21 +44,21 @@ tr '[:upper:][:lower:]' '[:upper:]a-z' < /dev/null || fail=1 tr '[:upper:] ' '[:lower:]' < /dev/null 2>out && fail=1 echo 'tr: when translating with string1 longer than string2, the latter string must not end with a character class' > exp -compare out exp || fail=1 +compare exp out || fail=1 # Up to coreutils-6.9, tr rejected an unmatched [:lower:] or [:upper:] in SET1. echo '#$%123abcABC' | tr '[:lower:]' '[.*]' > out || fail=1 echo '#$%123...ABC' > exp -compare out exp || fail=1 +compare exp out || fail=1 echo '#$%123abcABC' | tr '[:upper:]' '[.*]' > out || fail=1 echo '#$%123abc...' > exp -compare out exp || fail=1 +compare exp out || fail=1 # When doing a case-converting translation with something after the # [:upper:] and [:lower:] elements, ensure that tr honors the following byte. echo 'abc.' | tr '[:lower:].' '[:upper:]x' > out || fail=1 echo 'ABCx' > exp -compare out exp || fail=1 +compare exp out || fail=1 # Before coreutils 8.6 the disparate number of upper and lower # characters in some locales, triggered abort()s and invalid behavior @@ -73,41 +73,41 @@ if test "$(locale charmap 2>/dev/null)" = ISO-8859-1; then tr '[:upper:] ' '[:lower:]' < /dev/null 2>out && fail=1 echo 'tr: when translating with string1 longer than string2, the latter string must not end with a character class' > exp - compare out exp || fail=1 + compare exp out || fail=1 # Ensure when there are a different number of elements # in each string, we validate the case mapping correctly echo 'abc.xyz' | tr 'ab[:lower:]' '0-1[:upper:]' > out || fail=1 echo 'ABC.XYZ' > exp - compare out exp || fail=1 + compare exp out || fail=1 # Ensure we extend string2 appropriately echo 'ABC- XYZ' | tr '[:upper:]- ' '[:lower:]_' > out || fail=1 echo 'abc__xyz' > exp - compare out exp || fail=1 + compare exp out || fail=1 # Ensure the size of the case classes are accounted # for as a unit. echo 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' | tr '[:upper:]A-B' '[:lower:]0' >out || fail=1 echo '00cdefghijklmnopqrstuvwxyz' > exp - compare out exp || fail=1 + compare exp out || fail=1 # Ensure the size of the case classes are accounted # for as a unit. echo 'a' | tr -t '[:lower:]a' '[:upper:]0' >out || fail=1 echo '0' > exp - compare out exp || fail=1 + compare exp out || fail=1 # Ensure the size of the case classes are accounted # for as a unit. echo 'a' | tr -t '[:lower:][:lower:]a' '[:lower:][:upper:]0' >out || fail=1 echo '0' > exp - compare out exp || fail=1 + compare exp out || fail=1 fi Exit $fail diff --git a/tests/misc/truncate-fail-diag b/tests/misc/truncate-fail-diag index cea79d464..50cb5f411 100755 --- a/tests/misc/truncate-fail-diag +++ b/tests/misc/truncate-fail-diag @@ -32,7 +32,7 @@ truncate -s0 $dir > out 2>&1 && fail=1 cat <<EOF > exp truncate: cannot open \`$dir' for writing: No such file or directory EOF -compare out exp || fail=1 +compare exp out || fail=1 dir=$d1/ truncate -s0 $dir > out 2>&1 && fail=1 diff --git a/tests/misc/wc-files0 b/tests/misc/wc-files0 index 49df3b4b0..0cc4b8417 100755 --- a/tests/misc/wc-files0 +++ b/tests/misc/wc-files0 @@ -31,13 +31,13 @@ cat <<\EOF > exp || fail=1 2 3 10 total EOF -compare out exp || fail=1 +compare exp out || fail=1 if test "$fail" = ''; then # Repeat the above test, but read the file name list from stdin. rm -f out wc --files0-from=- < names > out || fail=1 - compare out exp || fail=1 + compare exp out || fail=1 fi Exit $fail |