2 # split must fail when given length/count of zero.
4 if test "$VERBOSE" = yes; then
9 . $srcdir/../lang-default
12 t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
13 trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
14 trap '(exit $?); exit $?' 1 2 13 15
17 mkdir -p $tmp || framework_failure=1
18 cd $tmp || framework_failure=1
19 touch in || framework_failure=1
21 if test $framework_failure = 1; then
22 echo "$0: failure in testing framework" 1>&2
28 split -a 0 in 2> /dev/null || fail=1
29 split -b 0 in 2> /dev/null && fail=1
30 split -C 0 in 2> /dev/null && fail=1
31 split -l 0 in 2> /dev/null && fail=1
33 # Make sure that the obsolete -N notation still works
34 split -1 in 2> /dev/null || fail=1
36 # Then make sure that -0 evokes a failure.
37 split -0 in 2> /dev/null && fail=1
39 # Ensure that split --lines=N and --bytes=N work for N=2^32,
40 # assuming our host supports integers that wide.
41 if _4gb=`expr 4294967296 + 0 2>/dev/null`; then
42 split --lines=$_4gb in || fail=1
43 split --bytes=$_4gb in || fail=1
46 # Currently (coreutils-5.0.1) split --line-bytes=M fails
47 # with `invalid number of bytes' for M=2^32 or larger. Actually,
48 # the limit is SIZE_MAX, which is 2^32 on 32-bit systems.
49 # On 64-bit systems, there's no problem with a count of 2^32,
50 # So disable this test in order to avoid the `failure' on 64-bit systems.
51 #split --line-bytes=$_4gb 2> /dev/null in && fail=1
53 # Make sure that a huge obsolete option evokes the right failure.
54 split -99999999999999999991 2> out && fail=1
56 # On losing systems (x86 Solaris 5.9 c89), we get a message like this:
57 # split: line count option -9999999999... is too large
58 # while on most, we get this:
59 # split: line count option -99999999999999999991... is too large
60 # so map them both to -99*.
61 sed 's/99[19]*/99*/' out > out-t
65 split: line count option -99*... is too large
68 test $fail = 1 && diff out exp 2> /dev/null
71 (exit $fail); exit $fail