mirror of
https://github.com/A2osX/A2osX.git
synced 2024-09-10 07:54:37 +00:00
84 lines
1.7 KiB
Plaintext
84 lines
1.7 KiB
Plaintext
NEW
|
||
PREFIX
|
||
AUTO 4,1
|
||
#!/BIN/SH
|
||
#
|
||
# 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 CATTEXT
|
||
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 CATTEXT
|
||
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
|
||
ECHO "\nThis next test CATs a binary file which should"
|
||
ECHO "be display as code in brackets []\n"
|
||
READ -P "Press Return to start test" Z
|
||
echo \n
|
||
SET T = $T + 1
|
||
CAT -A CATCHARS
|
||
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
|