A2osX/TESTS/CATTEST.txt

97 lines
1.9 KiB
Plaintext
Raw Permalink 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/SH
#
#
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
IF [ -N $Log ]
ECHO "Begin CAT Tests" >> ${Log}
ELSE
SET T = 0
SET F = 0
SET P = 0
FI
SET T = $T + 1
echo "\n"
CAT -N CATTEXT
echo "\n"
read -P "Did you see 8 numbered lines: " Z
ECHO
IF [ $Z = "y" ]
SET Z = "Y"
FI
IF [ $Z = "Y" ]
IF [ -N $Log ]
SET P = $P + 1
echo "CAT -N Passed" >> ${Log}
FI
ELSE
IF [ -N $Log ]
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 -N -S CATTEXT
echo "\n"
read -P "Did you see just 5 lines: " Z
ECHO
IF [ $Z = "y" ]
SET Z = "Y"
FI
IF [ $Z = "Y" ]
IF [ -N $Log ]
SET P = $P + 1
echo "CAT -S Passed" >> ${Log}
FI
ELSE
IF [ -N $Log ]
SET F = $F + 1
echo "CAT -S Failed" >> ${Log}
FI
FI
ECHO "\nThis next test CATs a special file and displays"
ECHO "its contents in code.\n"
READ -P "Press Return to start test" Z
echo "\n"
SET T = $T + 1
CAT -A CATCHARS
ECHO "\n\n"
ECHO "The following should have been displayed above:"
ECHO "[ENQ][ACK][BEL][BS][TAB][VT][FF][SI][DLE][DC1][DC2][DC3]"
ECHO "[DC4][NAK][SYN][ETB][CAN][EM][SUB][ESC][FS][GS][RS][US]"
ECHO
read -P "Is that what was displayed: " Z
ECHO
IF [ $Z = "y" ]
SET Z = "Y"
FI
IF [ $Z = "Y" ]
IF [ -N $Log ]
SET P = $P + 1
echo "CAT -A Passed" >> ${Log}
FI
ELSE
IF [ -N $Log ]
SET F = $F + 1
echo "CAT -A Failed" >> ${Log}
FI
FI
Echo "\nEnd of Cat Test"
IF [ -N $Log ]
echo "End of Cat Test" >> ${Log}
FI
SET C1 =
SET D1 =
SET Z =
MAN
TEXT /MAKE/USR/SHARE/TESTS/CATTEST