summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1997-11-02 14:24:16 +0000
committerJim Meyering <jim@meyering.net>1997-11-02 14:24:16 +0000
commit1b4242d63111795092a460311c044527e4d08617 (patch)
treed84e7fb0b6769254a24f62c242309d36fd49c1f3
parentc70a6df8c7b84d6cdcbf1c15efcc740fa69f2e6f (diff)
downloadcoreutils-1b4242d63111795092a460311c044527e4d08617.tar.xz
.
-rw-r--r--tests/wc/Makefile.am4
-rw-r--r--tests/wc/Makefile.in4
-rwxr-xr-xtests/wc/Test.pm1
-rwxr-xr-xtests/wc/wc-tests70
4 files changed, 74 insertions, 5 deletions
diff --git a/tests/wc/Makefile.am b/tests/wc/Makefile.am
index 953208373..b91c059d7 100644
--- a/tests/wc/Makefile.am
+++ b/tests/wc/Makefile.am
@@ -4,9 +4,9 @@
x = wc
explicit =
maint_gen = a0.I a0.X a1.I a1.X a2.I a2.X a3.I a3.X a4.I a4.X a5.I a5.X a6.I \
-a6.X a7.I a7.X a8.I a8.X a9.I a9.X b0.I b0.X b1.I b1.X
+a6.X a7.I a7.X a8.I a8.X a9.I a9.X b0.I b0.X b1.I b1.X c0.I c0.X c1.I c1.X
run_gen = a0.O a0.E a1.O a1.E a2.O a2.E a3.O a3.E a4.O a4.E a5.O a5.E a6.O \
-a6.E a7.O a7.E a8.O a8.E a9.O a9.E b0.O b0.E b1.O b1.E
+a6.E a7.O a7.E a8.O a8.E a9.O a9.E b0.O b0.E b1.O b1.E c0.O c0.E c1.O c1.E
##test-files-end
EXTRA_DIST = mk-script.pl Test.pm $x-tests $(explicit) $(maint_gen)
diff --git a/tests/wc/Makefile.in b/tests/wc/Makefile.in
index d3012de11..d2257014d 100644
--- a/tests/wc/Makefile.in
+++ b/tests/wc/Makefile.in
@@ -88,9 +88,9 @@ l = @l@
x = wc
explicit =
maint_gen = a0.I a0.X a1.I a1.X a2.I a2.X a3.I a3.X a4.I a4.X a5.I a5.X a6.I \
-a6.X a7.I a7.X a8.I a8.X a9.I a9.X b0.I b0.X b1.I b1.X
+a6.X a7.I a7.X a8.I a8.X a9.I a9.X b0.I b0.X b1.I b1.X c0.I c0.X c1.I c1.X
run_gen = a0.O a0.E a1.O a1.E a2.O a2.E a3.O a3.E a4.O a4.E a5.O a5.E a6.O \
-a6.E a7.O a7.E a8.O a8.E a9.O a9.E b0.O b0.E b1.O b1.E
+a6.E a7.O a7.E a8.O a8.E a9.O a9.E b0.O b0.E b1.O b1.E c0.O c0.E c1.O c1.E
EXTRA_DIST = mk-script.pl Test.pm $x-tests $(explicit) $(maint_gen)
noinst_SCRIPTS = $x-tests
diff --git a/tests/wc/Test.pm b/tests/wc/Test.pm
index 261f68e25..da81002f1 100755
--- a/tests/wc/Test.pm
+++ b/tests/wc/Test.pm
@@ -20,6 +20,7 @@ my @tv = (
['b0', '', "", " 0 0 0\n", 0],
['b1', '', "a b\nc\n", " 2 3 6\n", 0],
['c0', '-L', "1\n12\n", " 2\n", 0],
+['c0', '-L', "1\n123\n1\n", " 3\n", 0],
['c1', '-L', "\n123456", " 6\n", 0],
);
diff --git a/tests/wc/wc-tests b/tests/wc/wc-tests
index 1c5169a26..7716c736e 100755
--- a/tests/wc/wc-tests
+++ b/tests/wc/wc-tests
@@ -426,8 +426,76 @@ else
esac
fi
test -s b1.E || rm -f b1.E
+cat $srcdir/c0.I | $xx -L > c0.O 2> c0.E
+code=$?
+if test $code != 0 ; then
+ $echo "Test c0(|) failed: ../../src/wc return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp c0.O $srcdir/c0.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed c0(|)"; fi ;;
+ 1) $echo "Test c0(|) failed: files c0.O and $srcdir/c0.X differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test c0(|) may have failed." 1>&2;
+ $echo The command "cmp c0.O $srcdir/c0.X" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s c0.E || rm -f c0.E
+$xx -L < $srcdir/c0.I > c0.O 2> c0.E
+code=$?
+if test $code != 0 ; then
+ $echo "Test c0(<) failed: ../../src/wc return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp c0.O $srcdir/c0.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed c0(<)"; fi ;;
+ 1) $echo "Test c0(<) failed: files c0.O and $srcdir/c0.X differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test c0(<) may have failed." 1>&2;
+ $echo The command "cmp c0.O $srcdir/c0.X" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s c0.E || rm -f c0.E
+cat $srcdir/c1.I | $xx -L > c1.O 2> c1.E
+code=$?
+if test $code != 0 ; then
+ $echo "Test c1(|) failed: ../../src/wc return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp c1.O $srcdir/c1.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed c1(|)"; fi ;;
+ 1) $echo "Test c1(|) failed: files c1.O and $srcdir/c1.X differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test c1(|) may have failed." 1>&2;
+ $echo The command "cmp c1.O $srcdir/c1.X" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s c1.E || rm -f c1.E
+$xx -L < $srcdir/c1.I > c1.O 2> c1.E
+code=$?
+if test $code != 0 ; then
+ $echo "Test c1(<) failed: ../../src/wc return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp c1.O $srcdir/c1.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed c1(<)"; fi ;;
+ 1) $echo "Test c1(<) failed: files c1.O and $srcdir/c1.X differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test c1(<) may have failed." 1>&2;
+ $echo The command "cmp c1.O $srcdir/c1.X" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s c1.E || rm -f c1.E
if test $errors = 0 ; then
- $echo Passed all 24 tests. 1>&2
+ $echo Passed all 28 tests. 1>&2
else
$echo Failed $errors tests. 1>&2
fi