A2osX/TESTS/CATTEST

80 lines
1.5 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

NEW
PREFIX
AUTO 4,1
#!/BIN/SHELL
#
# We first need to check if this script is being called
# by BUILDTEST or if it is being run interactively.
#
IF [ -F ${ROOT}TMP/BUILDTEST ]
ELSE
SET B = 0
FI
#
ECHO "\f\n\n Cat Test"
echo "\nThis script will perform tests of the CAT command"
echo "\nThe first cats a file with line numbers at the left.\n"
READ -P "Press Return to start test" Z
SET T = $T + 1
echo \n
CAT -N CATFILE1
echo \n
read -P "Did you see 8 numbered lines: " Z
IF [ $Z = "y" ]
SET Z = "Y"
FI
IF [ $Z = "Y" ]
IF [ $B -GT 0 ]
SET P = $P + 1
echo "CAT -N Passed" >> ${Log}
FI
ELSE
IF [ $B -GT 0 ]
SET F = $F + 1
echo "CAT -N Failed" >> ${Log}
FI
FI
ECHO "\nThis next test CATs the same file but removes"
ECHO "the duplicate empty lines\n"
READ -P "Press Return to start test" Z
echo \n
SET T = $T + 1
CAT -S CATFILE1
echo \n
read -P "Did you just 4 lines: " Z
IF [ $Z = "y" ]
SET Z = "Y"
FI
IF [ $Z = "Y" ]
IF [ $B -GT 0 ]
SET P = $P + 1
echo "CAT -S Passed" >> ${Log}
FI
ELSE
IF [ $B -GT 0 ]
SET F = $F + 1
echo "CAT -S Failed" >> ${Log}
FI
FI
SET T = $T + 1
CAT -A CATFILE2
echo \n
read -P "Was the CAT display correct: " Z
IF [ $Z = "y" ]
SET Z = "Y"
FI
IF [ $Z = "Y" ]
IF [ $B -GT 0 ]
SET P = $P + 1
echo "CAT -A Passed" >> ${Log}
FI
ELSE
IF [ $B -GT 0 ]
SET F = $F + 1
echo "CAT -A Failed" >> ${Log}
FI
FI
Echo "\nEnd of Cat Test"
MAN
TEXT /MAKE/USR/SHARE/TESTS/CATTEST