summaryrefslogtreecommitdiff
path: root/tests/wc
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1997-11-02 14:28:13 +0000
committerJim Meyering <jim@meyering.net>1997-11-02 14:28:13 +0000
commitae21be058fc04224b32649606247115d8084f2ef (patch)
treea6ac103cb41e24b0036fcb9cc541b3741aa2c4a8 /tests/wc
parent53424a82782960e08cef3259bbb8082a187a9498 (diff)
downloadcoreutils-ae21be058fc04224b32649606247115d8084f2ef.tar.xz
.
Diffstat (limited to 'tests/wc')
-rw-r--r--tests/wc/Makefile.am6
-rw-r--r--tests/wc/Makefile.in6
-rwxr-xr-xtests/wc/wc-tests36
3 files changed, 43 insertions, 5 deletions
diff --git a/tests/wc/Makefile.am b/tests/wc/Makefile.am
index b91c059d7..e636f3daa 100644
--- a/tests/wc/Makefile.am
+++ b/tests/wc/Makefile.am
@@ -4,9 +4,11 @@
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 c0.I c0.X c1.I c1.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 \
+c2.I c2.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 c0.O c0.E c1.O c1.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 \
+c2.O c2.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 d2257014d..a3afdb848 100644
--- a/tests/wc/Makefile.in
+++ b/tests/wc/Makefile.in
@@ -88,9 +88,11 @@ 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 c0.I c0.X c1.I c1.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 \
+c2.I c2.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 c0.O c0.E c1.O c1.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 \
+c2.O c2.E
EXTRA_DIST = mk-script.pl Test.pm $x-tests $(explicit) $(maint_gen)
noinst_SCRIPTS = $x-tests
diff --git a/tests/wc/wc-tests b/tests/wc/wc-tests
index 7716c736e..a4129c85a 100755
--- a/tests/wc/wc-tests
+++ b/tests/wc/wc-tests
@@ -494,8 +494,42 @@ else
esac
fi
test -s c1.E || rm -f c1.E
+cat $srcdir/c2.I | $xx -L > c2.O 2> c2.E
+code=$?
+if test $code != 0 ; then
+ $echo "Test c2(|) failed: ../../src/wc return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp c2.O $srcdir/c2.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed c2(|)"; fi ;;
+ 1) $echo "Test c2(|) failed: files c2.O and $srcdir/c2.X differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test c2(|) may have failed." 1>&2;
+ $echo The command "cmp c2.O $srcdir/c2.X" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s c2.E || rm -f c2.E
+$xx -L < $srcdir/c2.I > c2.O 2> c2.E
+code=$?
+if test $code != 0 ; then
+ $echo "Test c2(<) failed: ../../src/wc return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp c2.O $srcdir/c2.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed c2(<)"; fi ;;
+ 1) $echo "Test c2(<) failed: files c2.O and $srcdir/c2.X differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test c2(<) may have failed." 1>&2;
+ $echo The command "cmp c2.O $srcdir/c2.X" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s c2.E || rm -f c2.E
if test $errors = 0 ; then
- $echo Passed all 28 tests. 1>&2
+ $echo Passed all 30 tests. 1>&2
else
$echo Failed $errors tests. 1>&2
fi