2 # This script takes no arguments.
4 if test "$VERBOSE" = yes; then
9 # Setting this envvar to a very small value used to cause e.g., `stty size'
10 # to generate slightly different output on certain systems.
14 # Make sure there's a tty on stdin.
17 # Versions of GNU stty from shellutils-1.9.2c and earlier failed
18 # tests #2 and #4 when run on SunOS 4.1.3.
21 1 rows_40_columns_80 40_80
22 2 rows_0_columns_0 0_0
23 3 rows_40_columns_80 40_80
34 saved_size
=.saved-size
36 stty size
> $saved_size ||
exit 1
42 expected_result
="`echo $3|tr _ ' '`"
43 test "$args" = empty
&& args
=''
44 test "x$args" = xLAST
&& break
45 args
=`echo x$args|tr _ ' '|sed 's/^x//'`
46 if test "$VERBOSE" = yes; then
47 # echo "testing \`stty $args; stty size\` = $expected_result ..."
48 echo "test $test_name... " |
tr -d '\012'
51 test x
"`stty size 2> /dev/null`" = "x$expected_result" \
52 && ok
=ok || ok
=FAIL fail
=1
53 test "$VERBOSE" = yes && echo $ok
57 stty
`cat $saved_size|sed 's/ / columns /;s/^/rows /'` ||
exit 1