A2osX/TESTS/CATTEST.txt

97 lines
1.9 KiB
Plaintext
Raw Normal View History

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
2019-03-07 02:13:28 +00:00
IF [ -N $Log ]
ECHO "Begin CAT Tests" >> ${Log}
ELSE
SET T = 0
SET F = 0
SET P = 0
FI
SET T = $T + 1
2019-03-07 02:13:28 +00:00
echo "\n"
CAT -N CATTEXT
2019-03-07 02:13:28 +00:00
echo "\n"
read -P "Did you see 8 numbered lines: " Z
2019-03-07 02:13:28 +00:00
ECHO
IF [ $Z = "y" ]
SET Z = "Y"
FI
IF [ $Z = "Y" ]
2019-03-07 02:13:28 +00:00
IF [ -N $Log ]
SET P = $P + 1
echo "CAT -N Passed" >> ${Log}
FI
ELSE
2019-03-07 02:13:28 +00:00
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
2019-03-07 02:13:28 +00:00
echo "\n"
SET T = $T + 1
2019-03-07 02:13:28 +00:00
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" ]
2019-03-07 02:13:28 +00:00
IF [ -N $Log ]
SET P = $P + 1
echo "CAT -S Passed" >> ${Log}
FI
ELSE
2019-03-07 02:13:28 +00:00
IF [ -N $Log ]
SET F = $F + 1
echo "CAT -S Failed" >> ${Log}
FI
FI
2019-03-07 02:13:28 +00:00
ECHO "\nThis next test CATs a special file and displays"
ECHO "its contents in code.\n"
READ -P "Press Return to start test" Z
2019-03-07 02:13:28 +00:00
echo "\n"
SET T = $T + 1
CAT -A CATCHARS
2019-03-07 02:13:28 +00:00
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" ]
2019-03-07 02:13:28 +00:00
IF [ -N $Log ]
SET P = $P + 1
echo "CAT -A Passed" >> ${Log}
FI
ELSE
2019-03-07 02:13:28 +00:00
IF [ -N $Log ]
SET F = $F + 1
echo "CAT -A Failed" >> ${Log}
FI
FI
Echo "\nEnd of Cat Test"
2019-03-07 02:13:28 +00:00
IF [ -N $Log ]
echo "End of Cat Test" >> ${Log}
FI
SET C1 =
SET D1 =
SET Z =
MAN
TEXT /MAKE/USR/SHARE/TESTS/CATTEST