summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/cut/Makefile.am8
-rw-r--r--tests/cut/Makefile.in8
-rwxr-xr-xtests/cut/cut-tests272
3 files changed, 283 insertions, 5 deletions
diff --git a/tests/cut/Makefile.am b/tests/cut/Makefile.am
index 037c7c224..e25a8d945 100644
--- a/tests/cut/Makefile.am
+++ b/tests/cut/Makefile.am
@@ -10,7 +10,9 @@ 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 o-delim.I o-delim.X \
nul-idelim.I nul-idelim.X nul-odelim.I nul-odelim.X multichar-od.I \
-multichar-od.X 8bit-delim.I 8bit-delim.X
+multichar-od.X 8bit-delim.I 8bit-delim.X out-delim1.I out-delim1.X \
+out-delim2.I out-delim2.X out-delim3.I out-delim3.X out-delim4.I out-delim4.X \
+out-delim5.I out-delim5.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 \
@@ -18,7 +20,9 @@ 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 o-delim.O o-delim.E \
nul-idelim.O nul-idelim.E nul-odelim.O nul-odelim.E multichar-od.O \
-multichar-od.E 8bit-delim.O 8bit-delim.E
+multichar-od.E 8bit-delim.O 8bit-delim.E out-delim1.O out-delim1.E \
+out-delim2.O out-delim2.E out-delim3.O out-delim3.E out-delim4.O out-delim4.E \
+out-delim5.O out-delim5.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 c13196d8d..99ff71689 100644
--- a/tests/cut/Makefile.in
+++ b/tests/cut/Makefile.in
@@ -157,7 +157,9 @@ 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 o-delim.I o-delim.X \
nul-idelim.I nul-idelim.X nul-odelim.I nul-odelim.X multichar-od.I \
-multichar-od.X 8bit-delim.I 8bit-delim.X
+multichar-od.X 8bit-delim.I 8bit-delim.X out-delim1.I out-delim1.X \
+out-delim2.I out-delim2.X out-delim3.I out-delim3.X out-delim4.I out-delim4.X \
+out-delim5.I out-delim5.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 \
@@ -166,7 +168,9 @@ 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 o-delim.O o-delim.E \
nul-idelim.O nul-idelim.E nul-odelim.O nul-odelim.E multichar-od.O \
-multichar-od.E 8bit-delim.O 8bit-delim.E
+multichar-od.E 8bit-delim.O 8bit-delim.E out-delim1.O out-delim1.E \
+out-delim2.O out-delim2.E out-delim3.O out-delim3.E out-delim4.O out-delim4.E \
+out-delim5.O out-delim5.E
EXTRA_DIST = Test.pm $x-tests $(explicit) $(maint_gen)
diff --git a/tests/cut/cut-tests b/tests/cut/cut-tests
index ecbd16750..7251c64a8 100755
--- a/tests/cut/cut-tests
+++ b/tests/cut/cut-tests
@@ -2394,8 +2394,278 @@ else
esac
fi
test -s 8bit-delim.E || rm -f 8bit-delim.E
+$xx -c1-3,5- --output-d=: $srcdir/out-delim1.I > out-delim1.O 2> out-delim1.E
+code=$?
+if test $code != 0; then
+ $echo "Test out-delim1(F) failed: ../../src/cut return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp out-delim1.O $srcdir/out-delim1.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE"; then $echo "passed out-delim1(F)"; fi;;
+ 1) $echo "Test out-delim1(F) failed: files out-delim1.O and $srcdir/out-delim1.X differ" 1>&2
+ (diff -c out-delim1.O $srcdir/out-delim1.X) 2> /dev/null
+ errors=`expr $errors + 1`;;
+ 2) $echo "Test out-delim1(F) may have failed." 1>&2
+ $echo The command "cmp out-delim1.O $srcdir/out-delim1.X" failed. 1>&2
+ errors=`expr $errors + 1`;;
+ esac
+fi
+test -s out-delim1.E || rm -f out-delim1.E
+cat $srcdir/out-delim1.I | $xx -c1-3,5- --output-d=: > out-delim1.O 2> out-delim1.E
+code=$?
+if test $code != 0; then
+ $echo "Test out-delim1(|) failed: ../../src/cut return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp out-delim1.O $srcdir/out-delim1.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE"; then $echo "passed out-delim1(|)"; fi;;
+ 1) $echo "Test out-delim1(|) failed: files out-delim1.O and $srcdir/out-delim1.X differ" 1>&2
+ (diff -c out-delim1.O $srcdir/out-delim1.X) 2> /dev/null
+ errors=`expr $errors + 1`;;
+ 2) $echo "Test out-delim1(|) may have failed." 1>&2
+ $echo The command "cmp out-delim1.O $srcdir/out-delim1.X" failed. 1>&2
+ errors=`expr $errors + 1`;;
+ esac
+fi
+test -s out-delim1.E || rm -f out-delim1.E
+$xx -c1-3,5- --output-d=: < $srcdir/out-delim1.I > out-delim1.O 2> out-delim1.E
+code=$?
+if test $code != 0; then
+ $echo "Test out-delim1(<) failed: ../../src/cut return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp out-delim1.O $srcdir/out-delim1.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE"; then $echo "passed out-delim1(<)"; fi;;
+ 1) $echo "Test out-delim1(<) failed: files out-delim1.O and $srcdir/out-delim1.X differ" 1>&2
+ (diff -c out-delim1.O $srcdir/out-delim1.X) 2> /dev/null
+ errors=`expr $errors + 1`;;
+ 2) $echo "Test out-delim1(<) may have failed." 1>&2
+ $echo The command "cmp out-delim1.O $srcdir/out-delim1.X" failed. 1>&2
+ errors=`expr $errors + 1`;;
+ esac
+fi
+test -s out-delim1.E || rm -f out-delim1.E
+$xx -c1-3,2,5- --output-d=: $srcdir/out-delim2.I > out-delim2.O 2> out-delim2.E
+code=$?
+if test $code != 0; then
+ $echo "Test out-delim2(F) failed: ../../src/cut return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp out-delim2.O $srcdir/out-delim2.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE"; then $echo "passed out-delim2(F)"; fi;;
+ 1) $echo "Test out-delim2(F) failed: files out-delim2.O and $srcdir/out-delim2.X differ" 1>&2
+ (diff -c out-delim2.O $srcdir/out-delim2.X) 2> /dev/null
+ errors=`expr $errors + 1`;;
+ 2) $echo "Test out-delim2(F) may have failed." 1>&2
+ $echo The command "cmp out-delim2.O $srcdir/out-delim2.X" failed. 1>&2
+ errors=`expr $errors + 1`;;
+ esac
+fi
+test -s out-delim2.E || rm -f out-delim2.E
+cat $srcdir/out-delim2.I | $xx -c1-3,2,5- --output-d=: > out-delim2.O 2> out-delim2.E
+code=$?
+if test $code != 0; then
+ $echo "Test out-delim2(|) failed: ../../src/cut return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp out-delim2.O $srcdir/out-delim2.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE"; then $echo "passed out-delim2(|)"; fi;;
+ 1) $echo "Test out-delim2(|) failed: files out-delim2.O and $srcdir/out-delim2.X differ" 1>&2
+ (diff -c out-delim2.O $srcdir/out-delim2.X) 2> /dev/null
+ errors=`expr $errors + 1`;;
+ 2) $echo "Test out-delim2(|) may have failed." 1>&2
+ $echo The command "cmp out-delim2.O $srcdir/out-delim2.X" failed. 1>&2
+ errors=`expr $errors + 1`;;
+ esac
+fi
+test -s out-delim2.E || rm -f out-delim2.E
+$xx -c1-3,2,5- --output-d=: < $srcdir/out-delim2.I > out-delim2.O 2> out-delim2.E
+code=$?
+if test $code != 0; then
+ $echo "Test out-delim2(<) failed: ../../src/cut return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp out-delim2.O $srcdir/out-delim2.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE"; then $echo "passed out-delim2(<)"; fi;;
+ 1) $echo "Test out-delim2(<) failed: files out-delim2.O and $srcdir/out-delim2.X differ" 1>&2
+ (diff -c out-delim2.O $srcdir/out-delim2.X) 2> /dev/null
+ errors=`expr $errors + 1`;;
+ 2) $echo "Test out-delim2(<) may have failed." 1>&2
+ $echo The command "cmp out-delim2.O $srcdir/out-delim2.X" failed. 1>&2
+ errors=`expr $errors + 1`;;
+ esac
+fi
+test -s out-delim2.E || rm -f out-delim2.E
+$xx -c1-3,2-4,6 --output-d=: $srcdir/out-delim3.I > out-delim3.O 2> out-delim3.E
+code=$?
+if test $code != 0; then
+ $echo "Test out-delim3(F) failed: ../../src/cut return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp out-delim3.O $srcdir/out-delim3.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE"; then $echo "passed out-delim3(F)"; fi;;
+ 1) $echo "Test out-delim3(F) failed: files out-delim3.O and $srcdir/out-delim3.X differ" 1>&2
+ (diff -c out-delim3.O $srcdir/out-delim3.X) 2> /dev/null
+ errors=`expr $errors + 1`;;
+ 2) $echo "Test out-delim3(F) may have failed." 1>&2
+ $echo The command "cmp out-delim3.O $srcdir/out-delim3.X" failed. 1>&2
+ errors=`expr $errors + 1`;;
+ esac
+fi
+test -s out-delim3.E || rm -f out-delim3.E
+cat $srcdir/out-delim3.I | $xx -c1-3,2-4,6 --output-d=: > out-delim3.O 2> out-delim3.E
+code=$?
+if test $code != 0; then
+ $echo "Test out-delim3(|) failed: ../../src/cut return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp out-delim3.O $srcdir/out-delim3.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE"; then $echo "passed out-delim3(|)"; fi;;
+ 1) $echo "Test out-delim3(|) failed: files out-delim3.O and $srcdir/out-delim3.X differ" 1>&2
+ (diff -c out-delim3.O $srcdir/out-delim3.X) 2> /dev/null
+ errors=`expr $errors + 1`;;
+ 2) $echo "Test out-delim3(|) may have failed." 1>&2
+ $echo The command "cmp out-delim3.O $srcdir/out-delim3.X" failed. 1>&2
+ errors=`expr $errors + 1`;;
+ esac
+fi
+test -s out-delim3.E || rm -f out-delim3.E
+$xx -c1-3,2-4,6 --output-d=: < $srcdir/out-delim3.I > out-delim3.O 2> out-delim3.E
+code=$?
+if test $code != 0; then
+ $echo "Test out-delim3(<) failed: ../../src/cut return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp out-delim3.O $srcdir/out-delim3.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE"; then $echo "passed out-delim3(<)"; fi;;
+ 1) $echo "Test out-delim3(<) failed: files out-delim3.O and $srcdir/out-delim3.X differ" 1>&2
+ (diff -c out-delim3.O $srcdir/out-delim3.X) 2> /dev/null
+ errors=`expr $errors + 1`;;
+ 2) $echo "Test out-delim3(<) may have failed." 1>&2
+ $echo The command "cmp out-delim3.O $srcdir/out-delim3.X" failed. 1>&2
+ errors=`expr $errors + 1`;;
+ esac
+fi
+test -s out-delim3.E || rm -f out-delim3.E
+$xx -c4-,2-3 --output-d=: $srcdir/out-delim4.I > out-delim4.O 2> out-delim4.E
+code=$?
+if test $code != 0; then
+ $echo "Test out-delim4(F) failed: ../../src/cut return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp out-delim4.O $srcdir/out-delim4.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE"; then $echo "passed out-delim4(F)"; fi;;
+ 1) $echo "Test out-delim4(F) failed: files out-delim4.O and $srcdir/out-delim4.X differ" 1>&2
+ (diff -c out-delim4.O $srcdir/out-delim4.X) 2> /dev/null
+ errors=`expr $errors + 1`;;
+ 2) $echo "Test out-delim4(F) may have failed." 1>&2
+ $echo The command "cmp out-delim4.O $srcdir/out-delim4.X" failed. 1>&2
+ errors=`expr $errors + 1`;;
+ esac
+fi
+test -s out-delim4.E || rm -f out-delim4.E
+cat $srcdir/out-delim4.I | $xx -c4-,2-3 --output-d=: > out-delim4.O 2> out-delim4.E
+code=$?
+if test $code != 0; then
+ $echo "Test out-delim4(|) failed: ../../src/cut return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp out-delim4.O $srcdir/out-delim4.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE"; then $echo "passed out-delim4(|)"; fi;;
+ 1) $echo "Test out-delim4(|) failed: files out-delim4.O and $srcdir/out-delim4.X differ" 1>&2
+ (diff -c out-delim4.O $srcdir/out-delim4.X) 2> /dev/null
+ errors=`expr $errors + 1`;;
+ 2) $echo "Test out-delim4(|) may have failed." 1>&2
+ $echo The command "cmp out-delim4.O $srcdir/out-delim4.X" failed. 1>&2
+ errors=`expr $errors + 1`;;
+ esac
+fi
+test -s out-delim4.E || rm -f out-delim4.E
+$xx -c4-,2-3 --output-d=: < $srcdir/out-delim4.I > out-delim4.O 2> out-delim4.E
+code=$?
+if test $code != 0; then
+ $echo "Test out-delim4(<) failed: ../../src/cut return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp out-delim4.O $srcdir/out-delim4.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE"; then $echo "passed out-delim4(<)"; fi;;
+ 1) $echo "Test out-delim4(<) failed: files out-delim4.O and $srcdir/out-delim4.X differ" 1>&2
+ (diff -c out-delim4.O $srcdir/out-delim4.X) 2> /dev/null
+ errors=`expr $errors + 1`;;
+ 2) $echo "Test out-delim4(<) may have failed." 1>&2
+ $echo The command "cmp out-delim4.O $srcdir/out-delim4.X" failed. 1>&2
+ errors=`expr $errors + 1`;;
+ esac
+fi
+test -s out-delim4.E || rm -f out-delim4.E
+$xx -c2-3,4- --output-d=: $srcdir/out-delim5.I > out-delim5.O 2> out-delim5.E
+code=$?
+if test $code != 0; then
+ $echo "Test out-delim5(F) failed: ../../src/cut return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp out-delim5.O $srcdir/out-delim5.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE"; then $echo "passed out-delim5(F)"; fi;;
+ 1) $echo "Test out-delim5(F) failed: files out-delim5.O and $srcdir/out-delim5.X differ" 1>&2
+ (diff -c out-delim5.O $srcdir/out-delim5.X) 2> /dev/null
+ errors=`expr $errors + 1`;;
+ 2) $echo "Test out-delim5(F) may have failed." 1>&2
+ $echo The command "cmp out-delim5.O $srcdir/out-delim5.X" failed. 1>&2
+ errors=`expr $errors + 1`;;
+ esac
+fi
+test -s out-delim5.E || rm -f out-delim5.E
+cat $srcdir/out-delim5.I | $xx -c2-3,4- --output-d=: > out-delim5.O 2> out-delim5.E
+code=$?
+if test $code != 0; then
+ $echo "Test out-delim5(|) failed: ../../src/cut return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp out-delim5.O $srcdir/out-delim5.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE"; then $echo "passed out-delim5(|)"; fi;;
+ 1) $echo "Test out-delim5(|) failed: files out-delim5.O and $srcdir/out-delim5.X differ" 1>&2
+ (diff -c out-delim5.O $srcdir/out-delim5.X) 2> /dev/null
+ errors=`expr $errors + 1`;;
+ 2) $echo "Test out-delim5(|) may have failed." 1>&2
+ $echo The command "cmp out-delim5.O $srcdir/out-delim5.X" failed. 1>&2
+ errors=`expr $errors + 1`;;
+ esac
+fi
+test -s out-delim5.E || rm -f out-delim5.E
+$xx -c2-3,4- --output-d=: < $srcdir/out-delim5.I > out-delim5.O 2> out-delim5.E
+code=$?
+if test $code != 0; then
+ $echo "Test out-delim5(<) failed: ../../src/cut return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp out-delim5.O $srcdir/out-delim5.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE"; then $echo "passed out-delim5(<)"; fi;;
+ 1) $echo "Test out-delim5(<) failed: files out-delim5.O and $srcdir/out-delim5.X differ" 1>&2
+ (diff -c out-delim5.O $srcdir/out-delim5.X) 2> /dev/null
+ errors=`expr $errors + 1`;;
+ 2) $echo "Test out-delim5(<) may have failed." 1>&2
+ $echo The command "cmp out-delim5.O $srcdir/out-delim5.X" failed. 1>&2
+ errors=`expr $errors + 1`;;
+ esac
+fi
+test -s out-delim5.E || rm -f out-delim5.E
if test $errors = 0; then
- $echo Passed all 132 tests. 1>&2
+ $echo Passed all 147 tests. 1>&2
else
$echo Failed $errors tests. 1>&2
fi