summaryrefslogtreecommitdiff
path: root/tests/cut
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1998-07-26 04:06:55 +0000
committerJim Meyering <jim@meyering.net>1998-07-26 04:06:55 +0000
commit3e3b8558d64e468ae9814ef76f0d179dba31b8fd (patch)
tree28653e0132a0fcd0ed9b07936c41d10ae830219d /tests/cut
parent5c4cb177efd8b83fdf333f1a054cc76b89f21339 (diff)
downloadcoreutils-3e3b8558d64e468ae9814ef76f0d179dba31b8fd.tar.xz
.
Diffstat (limited to 'tests/cut')
-rw-r--r--tests/cut/Makefile.am8
-rw-r--r--tests/cut/Makefile.in9
-rwxr-xr-xtests/cut/cut-tests206
3 files changed, 217 insertions, 6 deletions
diff --git a/tests/cut/Makefile.am b/tests/cut/Makefile.am
index 84433e8b7..4ae1fd3e2 100644
--- a/tests/cut/Makefile.am
+++ b/tests/cut/Makefile.am
@@ -8,13 +8,17 @@ maint_gen = 1.I 1.X 2.I 2.X 3.I 3.X 4.I 4.X 5.I 5.X 6.I 6.X 7.I 7.X 8.I 8.X \
i.X j.I j.X k.I k.X l.I l.X m.I m.X n.I n.X o.I o.X p.I p.X q.I q.X r.I r.X \
s.I s.X t.I t.X u.I u.X v.I v.X w.I w.X x.I x.X y.I y.X z.I z.X empty-fl.I \
empty-fl.X missing-fl.I missing-fl.X empty-bl.I empty-bl.X missing-bl.I \
-missing-bl.X empty-f1.I empty-f1.X empty-f2.I empty-f2.X
+missing-bl.X empty-f1.I empty-f1.X empty-f2.I empty-f2.X o-delim.I o-delim.X \
+nul-idelim.I nul-idelim.X nul-odelim.I nul-odelim.X multichar-od.I \
+multichar-od.X
run_gen = 1.O 1.E 2.O 2.E 3.O 3.E 4.O 4.E 5.O 5.E 6.O 6.E 7.O 7.E 8.O 8.E 9.O \
9.E a.O a.E b.O b.E c.O c.E d.O d.E e.O e.E f.O f.E g.O g.E h.O h.E i.O i.E \
j.O j.E k.O k.E l.O l.E m.O m.E n.O n.E o.O o.E p.O p.E q.O q.E r.O r.E s.O \
s.E t.O t.E u.O u.E v.O v.E w.O w.E x.O x.E y.O y.E z.O z.E empty-fl.O \
empty-fl.E missing-fl.O missing-fl.E empty-bl.O empty-bl.E missing-bl.O \
-missing-bl.E empty-f1.O empty-f1.E empty-f2.O empty-f2.E
+missing-bl.E empty-f1.O empty-f1.E empty-f2.O empty-f2.E o-delim.O o-delim.E \
+nul-idelim.O nul-idelim.E nul-odelim.O nul-odelim.E multichar-od.O \
+multichar-od.E
##test-files-end
EXTRA_DIST = Test.pm $x-tests $(explicit) $(maint_gen)
diff --git a/tests/cut/Makefile.in b/tests/cut/Makefile.in
index 29fdf891e..174f8473e 100644
--- a/tests/cut/Makefile.in
+++ b/tests/cut/Makefile.in
@@ -4,7 +4,6 @@
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
@@ -94,13 +93,17 @@ maint_gen = 1.I 1.X 2.I 2.X 3.I 3.X 4.I 4.X 5.I 5.X 6.I 6.X 7.I 7.X 8.I 8.X \
i.X j.I j.X k.I k.X l.I l.X m.I m.X n.I n.X o.I o.X p.I p.X q.I q.X r.I r.X \
s.I s.X t.I t.X u.I u.X v.I v.X w.I w.X x.I x.X y.I y.X z.I z.X empty-fl.I \
empty-fl.X missing-fl.I missing-fl.X empty-bl.I empty-bl.X missing-bl.I \
-missing-bl.X empty-f1.I empty-f1.X empty-f2.I empty-f2.X
+missing-bl.X empty-f1.I empty-f1.X empty-f2.I empty-f2.X o-delim.I o-delim.X \
+nul-idelim.I nul-idelim.X nul-odelim.I nul-odelim.X multichar-od.I \
+multichar-od.X
run_gen = 1.O 1.E 2.O 2.E 3.O 3.E 4.O 4.E 5.O 5.E 6.O 6.E 7.O 7.E 8.O 8.E 9.O \
9.E a.O a.E b.O b.E c.O c.E d.O d.E e.O e.E f.O f.E g.O g.E h.O h.E i.O i.E \
j.O j.E k.O k.E l.O l.E m.O m.E n.O n.E o.O o.E p.O p.E q.O q.E r.O r.E s.O \
s.E t.O t.E u.O u.E v.O v.E w.O w.E x.O x.E y.O y.E z.O z.E empty-fl.O \
empty-fl.E missing-fl.O missing-fl.E empty-bl.O empty-bl.E missing-bl.O \
-missing-bl.E empty-f1.O empty-f1.E empty-f2.O empty-f2.E
+missing-bl.E empty-f1.O empty-f1.E empty-f2.O empty-f2.E o-delim.O o-delim.E \
+nul-idelim.O nul-idelim.E nul-odelim.O nul-odelim.E multichar-od.O \
+multichar-od.E
EXTRA_DIST = Test.pm $x-tests $(explicit) $(maint_gen)
noinst_SCRIPTS = $x-tests
diff --git a/tests/cut/cut-tests b/tests/cut/cut-tests
index cc2460bc9..e4fe94bed 100755
--- a/tests/cut/cut-tests
+++ b/tests/cut/cut-tests
@@ -2109,8 +2109,212 @@ else
esac
fi
test -s empty-f2.E || rm -f empty-f2.E
+$xx -d: -f2,3 --out=_ $srcdir/o-delim.I > o-delim.O 2> o-delim.E
+code=$?
+if test $code != 0 ; then
+ $echo "Test o-delim(F) failed: ../../src/cut return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp o-delim.O $srcdir/o-delim.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed o-delim(F)"; fi ;;
+ 1) $echo "Test o-delim(F) failed: files o-delim.O and $srcdir/o-delim.X differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test o-delim(F) may have failed." 1>&2;
+ $echo The command "cmp o-delim.O $srcdir/o-delim.X" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s o-delim.E || rm -f o-delim.E
+cat $srcdir/o-delim.I | $xx -d: -f2,3 --out=_ > o-delim.O 2> o-delim.E
+code=$?
+if test $code != 0 ; then
+ $echo "Test o-delim(|) failed: ../../src/cut return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp o-delim.O $srcdir/o-delim.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed o-delim(|)"; fi ;;
+ 1) $echo "Test o-delim(|) failed: files o-delim.O and $srcdir/o-delim.X differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test o-delim(|) may have failed." 1>&2;
+ $echo The command "cmp o-delim.O $srcdir/o-delim.X" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s o-delim.E || rm -f o-delim.E
+$xx -d: -f2,3 --out=_ < $srcdir/o-delim.I > o-delim.O 2> o-delim.E
+code=$?
+if test $code != 0 ; then
+ $echo "Test o-delim(<) failed: ../../src/cut return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp o-delim.O $srcdir/o-delim.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed o-delim(<)"; fi ;;
+ 1) $echo "Test o-delim(<) failed: files o-delim.O and $srcdir/o-delim.X differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test o-delim(<) may have failed." 1>&2;
+ $echo The command "cmp o-delim.O $srcdir/o-delim.X" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s o-delim.E || rm -f o-delim.E
+$xx -d '' -f2,3 --out=_ $srcdir/nul-idelim.I > nul-idelim.O 2> nul-idelim.E
+code=$?
+if test $code != 0 ; then
+ $echo "Test nul-idelim(F) failed: ../../src/cut return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp nul-idelim.O $srcdir/nul-idelim.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed nul-idelim(F)"; fi ;;
+ 1) $echo "Test nul-idelim(F) failed: files nul-idelim.O and $srcdir/nul-idelim.X differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test nul-idelim(F) may have failed." 1>&2;
+ $echo The command "cmp nul-idelim.O $srcdir/nul-idelim.X" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s nul-idelim.E || rm -f nul-idelim.E
+cat $srcdir/nul-idelim.I | $xx -d '' -f2,3 --out=_ > nul-idelim.O 2> nul-idelim.E
+code=$?
+if test $code != 0 ; then
+ $echo "Test nul-idelim(|) failed: ../../src/cut return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp nul-idelim.O $srcdir/nul-idelim.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed nul-idelim(|)"; fi ;;
+ 1) $echo "Test nul-idelim(|) failed: files nul-idelim.O and $srcdir/nul-idelim.X differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test nul-idelim(|) may have failed." 1>&2;
+ $echo The command "cmp nul-idelim.O $srcdir/nul-idelim.X" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s nul-idelim.E || rm -f nul-idelim.E
+$xx -d '' -f2,3 --out=_ < $srcdir/nul-idelim.I > nul-idelim.O 2> nul-idelim.E
+code=$?
+if test $code != 0 ; then
+ $echo "Test nul-idelim(<) failed: ../../src/cut return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp nul-idelim.O $srcdir/nul-idelim.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed nul-idelim(<)"; fi ;;
+ 1) $echo "Test nul-idelim(<) failed: files nul-idelim.O and $srcdir/nul-idelim.X differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test nul-idelim(<) may have failed." 1>&2;
+ $echo The command "cmp nul-idelim.O $srcdir/nul-idelim.X" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s nul-idelim.E || rm -f nul-idelim.E
+$xx -d: -f2,3 --out= $srcdir/nul-odelim.I > nul-odelim.O 2> nul-odelim.E
+code=$?
+if test $code != 0 ; then
+ $echo "Test nul-odelim(F) failed: ../../src/cut return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp nul-odelim.O $srcdir/nul-odelim.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed nul-odelim(F)"; fi ;;
+ 1) $echo "Test nul-odelim(F) failed: files nul-odelim.O and $srcdir/nul-odelim.X differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test nul-odelim(F) may have failed." 1>&2;
+ $echo The command "cmp nul-odelim.O $srcdir/nul-odelim.X" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s nul-odelim.E || rm -f nul-odelim.E
+cat $srcdir/nul-odelim.I | $xx -d: -f2,3 --out= > nul-odelim.O 2> nul-odelim.E
+code=$?
+if test $code != 0 ; then
+ $echo "Test nul-odelim(|) failed: ../../src/cut return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp nul-odelim.O $srcdir/nul-odelim.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed nul-odelim(|)"; fi ;;
+ 1) $echo "Test nul-odelim(|) failed: files nul-odelim.O and $srcdir/nul-odelim.X differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test nul-odelim(|) may have failed." 1>&2;
+ $echo The command "cmp nul-odelim.O $srcdir/nul-odelim.X" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s nul-odelim.E || rm -f nul-odelim.E
+$xx -d: -f2,3 --out= < $srcdir/nul-odelim.I > nul-odelim.O 2> nul-odelim.E
+code=$?
+if test $code != 0 ; then
+ $echo "Test nul-odelim(<) failed: ../../src/cut return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp nul-odelim.O $srcdir/nul-odelim.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed nul-odelim(<)"; fi ;;
+ 1) $echo "Test nul-odelim(<) failed: files nul-odelim.O and $srcdir/nul-odelim.X differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test nul-odelim(<) may have failed." 1>&2;
+ $echo The command "cmp nul-odelim.O $srcdir/nul-odelim.X" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s nul-odelim.E || rm -f nul-odelim.E
+$xx -d: -f2,3 --out=_._ $srcdir/multichar-od.I > multichar-od.O 2> multichar-od.E
+code=$?
+if test $code != 0 ; then
+ $echo "Test multichar-od(F) failed: ../../src/cut return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp multichar-od.O $srcdir/multichar-od.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed multichar-od(F)"; fi ;;
+ 1) $echo "Test multichar-od(F) failed: files multichar-od.O and $srcdir/multichar-od.X differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test multichar-od(F) may have failed." 1>&2;
+ $echo The command "cmp multichar-od.O $srcdir/multichar-od.X" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s multichar-od.E || rm -f multichar-od.E
+cat $srcdir/multichar-od.I | $xx -d: -f2,3 --out=_._ > multichar-od.O 2> multichar-od.E
+code=$?
+if test $code != 0 ; then
+ $echo "Test multichar-od(|) failed: ../../src/cut return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp multichar-od.O $srcdir/multichar-od.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed multichar-od(|)"; fi ;;
+ 1) $echo "Test multichar-od(|) failed: files multichar-od.O and $srcdir/multichar-od.X differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test multichar-od(|) may have failed." 1>&2;
+ $echo The command "cmp multichar-od.O $srcdir/multichar-od.X" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s multichar-od.E || rm -f multichar-od.E
+$xx -d: -f2,3 --out=_._ < $srcdir/multichar-od.I > multichar-od.O 2> multichar-od.E
+code=$?
+if test $code != 0 ; then
+ $echo "Test multichar-od(<) failed: ../../src/cut return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp multichar-od.O $srcdir/multichar-od.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed multichar-od(<)"; fi ;;
+ 1) $echo "Test multichar-od(<) failed: files multichar-od.O and $srcdir/multichar-od.X differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test multichar-od(<) may have failed." 1>&2;
+ $echo The command "cmp multichar-od.O $srcdir/multichar-od.X" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s multichar-od.E || rm -f multichar-od.E
if test $errors = 0 ; then
- $echo Passed all 123 tests. 1>&2
+ $echo Passed all 135 tests. 1>&2
else
$echo Failed $errors tests. 1>&2
fi