summaryrefslogtreecommitdiff
path: root/tests/tr
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2002-01-18 23:56:59 +0000
committerJim Meyering <jim@meyering.net>2002-01-18 23:56:59 +0000
commit2bd66cf7fcc2296af4d6b84079ff63330eed1433 (patch)
tree54c442d95127df934e4452f47f1923bf24e72aa2 /tests/tr
parent8e7e29d1de6823fc4f4e98c873c58d904a1e7b36 (diff)
downloadcoreutils-2bd66cf7fcc2296af4d6b84079ff63330eed1433.tar.xz
.
Diffstat (limited to 'tests/tr')
-rw-r--r--tests/tr/Makefile.am6
-rwxr-xr-xtests/tr/tr-tests74
2 files changed, 77 insertions, 3 deletions
diff --git a/tests/tr/Makefile.am b/tests/tr/Makefile.am
index b8e6945e2..398d0fbc3 100644
--- a/tests/tr/Makefile.am
+++ b/tests/tr/Makefile.am
@@ -11,7 +11,8 @@ range-a-a.X null.I null.X upcase.I upcase.X dncase.I dncase.X rep-cclass.I \
rep-cclass.X rep-1.I rep-1.X rep-2.I rep-2.X rep-3.I rep-3.X o-rep-1.I \
o-rep-1.X o-rep-2.I o-rep-2.X esc.I esc.X ross-0a.I ross-0a.X ross-0b.I \
ross-0b.X ross-1a.I ross-1a.X ross-1b.I ross-1b.X ross-2.I ross-2.X ross-3.I \
-ross-3.X ross-4.I ross-4.X ross-5.I ross-5.X ross-6.I ross-6.X
+ross-3.X ross-4.I ross-4.X ross-5.I ross-5.X ross-6.I ross-6.X empty-eq.I \
+empty-eq.X empty-cc.I empty-cc.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 \
@@ -20,7 +21,8 @@ range-a-a.E null.O null.E upcase.O upcase.E dncase.O dncase.E rep-cclass.O \
rep-cclass.E rep-1.O rep-1.E rep-2.O rep-2.E rep-3.O rep-3.E o-rep-1.O \
o-rep-1.E o-rep-2.O o-rep-2.E esc.O esc.E ross-0a.O ross-0a.E ross-0b.O \
ross-0b.E ross-1a.O ross-1a.E ross-1b.O ross-1b.E ross-2.O ross-2.E ross-3.O \
-ross-3.E ross-4.O ross-4.E ross-5.O ross-5.E ross-6.O ross-6.E
+ross-3.E ross-4.O ross-4.E ross-5.O ross-5.E ross-6.O ross-6.E empty-eq.O \
+empty-eq.E empty-cc.O empty-cc.E
##test-files-end
EXTRA_DIST = Test.pm $x-tests $(explicit) $(maint_gen)
diff --git a/tests/tr/tr-tests b/tests/tr/tr-tests
index 5d7d27839..92f62dfa6 100755
--- a/tests/tr/tr-tests
+++ b/tests/tr/tr-tests
@@ -1998,8 +1998,80 @@ else
esac
fi
test -s ross-6.E || rm -f ross-6.E
+cat $srcdir/empty-eq.I | $xx '[==]' x > empty-eq.O 2> empty-eq.E
+code=$?
+if test $code != 1; then
+ $echo "Test empty-eq(|) failed: ../../src/tr return code $code differs from expected value 1" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp empty-eq.O $srcdir/empty-eq.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE"; then $echo "passed empty-eq(|)"; fi;;
+ 1) $echo "Test empty-eq(|) failed: files empty-eq.O and $srcdir/empty-eq.X differ" 1>&2
+ (diff -c empty-eq.O $srcdir/empty-eq.X) 2> /dev/null
+ errors=`expr $errors + 1`;;
+ 2) $echo "Test empty-eq(|) may have failed." 1>&2
+ $echo The command "cmp empty-eq.O $srcdir/empty-eq.X" failed. 1>&2
+ errors=`expr $errors + 1`;;
+ esac
+fi
+test -s empty-eq.E || rm -f empty-eq.E
+$xx '[==]' x < $srcdir/empty-eq.I > empty-eq.O 2> empty-eq.E
+code=$?
+if test $code != 1; then
+ $echo "Test empty-eq(<) failed: ../../src/tr return code $code differs from expected value 1" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp empty-eq.O $srcdir/empty-eq.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE"; then $echo "passed empty-eq(<)"; fi;;
+ 1) $echo "Test empty-eq(<) failed: files empty-eq.O and $srcdir/empty-eq.X differ" 1>&2
+ (diff -c empty-eq.O $srcdir/empty-eq.X) 2> /dev/null
+ errors=`expr $errors + 1`;;
+ 2) $echo "Test empty-eq(<) may have failed." 1>&2
+ $echo The command "cmp empty-eq.O $srcdir/empty-eq.X" failed. 1>&2
+ errors=`expr $errors + 1`;;
+ esac
+fi
+test -s empty-eq.E || rm -f empty-eq.E
+cat $srcdir/empty-cc.I | $xx '[::]' x > empty-cc.O 2> empty-cc.E
+code=$?
+if test $code != 1; then
+ $echo "Test empty-cc(|) failed: ../../src/tr return code $code differs from expected value 1" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp empty-cc.O $srcdir/empty-cc.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE"; then $echo "passed empty-cc(|)"; fi;;
+ 1) $echo "Test empty-cc(|) failed: files empty-cc.O and $srcdir/empty-cc.X differ" 1>&2
+ (diff -c empty-cc.O $srcdir/empty-cc.X) 2> /dev/null
+ errors=`expr $errors + 1`;;
+ 2) $echo "Test empty-cc(|) may have failed." 1>&2
+ $echo The command "cmp empty-cc.O $srcdir/empty-cc.X" failed. 1>&2
+ errors=`expr $errors + 1`;;
+ esac
+fi
+test -s empty-cc.E || rm -f empty-cc.E
+$xx '[::]' x < $srcdir/empty-cc.I > empty-cc.O 2> empty-cc.E
+code=$?
+if test $code != 1; then
+ $echo "Test empty-cc(<) failed: ../../src/tr return code $code differs from expected value 1" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp empty-cc.O $srcdir/empty-cc.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE"; then $echo "passed empty-cc(<)"; fi;;
+ 1) $echo "Test empty-cc(<) failed: files empty-cc.O and $srcdir/empty-cc.X differ" 1>&2
+ (diff -c empty-cc.O $srcdir/empty-cc.X) 2> /dev/null
+ errors=`expr $errors + 1`;;
+ 2) $echo "Test empty-cc(<) may have failed." 1>&2
+ $echo The command "cmp empty-cc.O $srcdir/empty-cc.X" failed. 1>&2
+ errors=`expr $errors + 1`;;
+ esac
+fi
+test -s empty-cc.E || rm -f empty-cc.E
if test $errors = 0; then
- $echo Passed all 110 tests. 1>&2
+ $echo Passed all 114 tests. 1>&2
else
$echo Failed $errors tests. 1>&2
fi