diff options
Diffstat (limited to 'tests/stty/row-col-1')
-rwxr-xr-x | tests/stty/row-col-1 | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/tests/stty/row-col-1 b/tests/stty/row-col-1 new file mode 100755 index 000000000..09aa6fd65 --- /dev/null +++ b/tests/stty/row-col-1 @@ -0,0 +1,54 @@ +#! /bin/sh +# This script takes no arguments. + +: ${STTY=stty} + +if test "$VERBOSE" = yes; then + set -x + $RM --version +fi + +# Versions of GNU stty from shellutils-1.9.2c and earlier failed +# tests #2 and #4 when run on SunOS 4.1.3. + +tests=' +1 rows_40_columns_80 40_80 +2 rows_0_columns_0 0_0 +3 rows_40_columns_80 40_80 +4 rows_0 0_80 +5 columns_0 0_0 +6 rows_40 40_0 +7 rows_0 0_0 +8 columns_80 0_80 +9 rows_30 30_80 +NA LAST NA +' +set - $tests + +saved_size=.saved-size + +$STTY size > $saved_size || exit 1 + +fail=0 +while :; do + test_name=$1 + args=$2 + expected_result="`echo $3|tr _ ' '`" + test "$args" = empty && args='' + test "x$args" = xLAST && break + args=`echo x$args|tr _ ' '|sed 's/^x//'` + if test "$VERBOSE" = yes; then + # echo "testing \`$STTY $args; $STTY size\` = $expected_result ..." + echo "test $test_name... " | tr -d '\012' + fi + $STTY $args || exit 1 + test x"`$STTY size 2> /dev/null`" = "x$expected_result" \ + && ok=ok || ok=FAIL fail=1 + test "$VERBOSE" = yes && echo $ok + shift; shift; shift +done + +$STTY `cat $saved_size|sed 's/ / columns /;s/^/rows /'` || exit 1 +rm -f $saved_size + +exit $fail |