diff options
author | Jim Meyering <jim@meyering.net> | 2001-11-22 08:46:23 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2001-11-22 08:46:23 +0000 |
commit | 5d0c6e59ac674ca28c0dd4661f004a060486f9ed (patch) | |
tree | e6e87bfadee157e0b7c45440f625bf6d1998d9d8 | |
parent | d62d8770a6ca7dc471c9e975b3635d8c035b0e5d (diff) | |
download | coreutils-5d0c6e59ac674ca28c0dd4661f004a060486f9ed.tar.xz |
*** empty log message ***
-rwxr-xr-x | tests/misc/csplit | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/misc/csplit b/tests/misc/csplit new file mode 100755 index 000000000..536ffd513 --- /dev/null +++ b/tests/misc/csplit @@ -0,0 +1,39 @@ +#!/bin/sh +# csplit could get a failed assertion prior to 2.0.17 + +if test "$VERBOSE" = yes; then + set -x + csplit --version +fi + +. $srcdir/../lang-default + +pwd=`pwd` +tmp=csplit.$$ +trap 'status=$?; cd $pwd; rm -rf $tmp && exit $status' 0 +trap '(exit $?); exit' 1 2 13 15 + +framework_failure=0 +mkdir $tmp || framework_failure=1 +cd $tmp || framework_failure=1 + +if test $framework_failure = 1; then + echo '$0: failure in testing framework' 1>&2 + (exit 1); exit +fi + +fail=0 + +(echo a; echo; echo) > in +csplit in '/^$/' 2 > out || fail=1 + +cat <<EOF > exp +2 +0 +2 +EOF + +cmp out exp || fail=1 +test $fail = 1 && diff out exp 2> /dev/null + +(exit $fail); exit |