diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-08-21 05:23:24 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-08-21 05:23:24 +0000 |
commit | a3ec215973c3653ebdeb81dcdd1274519c376a3d (patch) | |
tree | dc0edc2133786db0565f19d51c4a9957dd69e2ac /tests/basic | |
download | diffutils-tarball-a3ec215973c3653ebdeb81dcdd1274519c376a3d.tar.gz |
diffutils-3.5HEADdiffutils-3.5master
Diffstat (limited to 'tests/basic')
-rwxr-xr-x | tests/basic | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/basic b/tests/basic new file mode 100755 index 0000000..45b9c9c --- /dev/null +++ b/tests/basic @@ -0,0 +1,42 @@ +#!/bin/sh +# small examples + +. "${srcdir=.}/init.sh"; path_prepend_ ../src + +fail=0 + +cat <<EOF > exp- || fail=1 +1c1 +< a +--- +> b +EOF + +cat <<EOF > exp--u || fail=1 +--- a ++++ b +@@ -1 +1 @@ +-a ++b +EOF + +cat <<EOF > exp--c || fail=1 +*** a +--- b +*************** +*** 1 **** +! a +--- 1 ---- +! b +EOF + +echo a > a +echo b > b +for opt in '' -u -c; do + diff $opt a b > out 2> err; test $? = 1 || fail=1 + # Remove date and time. + sed -e 's/^\([-+*][-+*][-+*] [^ ]*\) .*/\1/' out > k; mv k out + compare exp-$(echo $opt|tr ' ' _) out || fail=1 +done + +Exit $fail |