Updated several test scripts and added new ones. RUN IFSTRTEST and READIF tests.

This commit is contained in:
Patrick Kloepfer 2019-02-21 16:19:56 -05:00
parent 55a8f975b8
commit c5ee866919
6 changed files with 57 additions and 4 deletions

Binary file not shown.

View File

@ -1,4 +1,11 @@
#!/BIN/SHELL
NEW
PREFIX
AUTO 4,1
#!/BIN/SH
#
#
#
#!/BIN/SH
ECHO \f IF String Tests
ECHO \n\n This Performs Several String Comparison Tests
ECHO Test 1 ABC = ABC
@ -27,3 +34,5 @@ echo This Test Failed
ELSE
echo This Test Passed
FI
MAN
TEXT /MAKE/USR/SHARE/TESTS/IFSTRTEST

25
TESTS/READIF Normal file
View File

@ -0,0 +1,25 @@
NEW
PREFIX
AUTO 4,1
#!/BIN/SH
#
# This script uses READ to set a VAR and then attempts
# to test it for validity as a String or Number
#
ECHO "\n\nBasic READ and IF Testing\n\n"
READ -P "Please type and A and press return: " Z
ECHO "\nYou typed: $Z\n"
IF [ $Z = "A" ]
ECHO "Test Passed First IF"
ELSE
ECHO "Test Failed First IF"
FI
READ -P "Please type and 1 and press return: " Z
ECHO "\nYou typed: $Z\n"
IF [ $Z = "1" ]
ECHO "Test Passed Second IF"
ELSE
ECHO "Test Failed Second IF"
FI
MAN
TEXT /MAKE/USR/SHARE/TESTS/READIF

19
TESTS/SKIPBLOCK Normal file
View File

@ -0,0 +1,19 @@
NEW
PREFIX
AUTO 4,1
#!/BIN/SH
#
# This script tests to see the Script Engine doesnt evaluate
# a block that should not be reached by code
#
IF [ 1 -EQ 1 ]
# This block should be executed
ECHO "If only this message appears then this test PASSED"
ELSE
# This block should not so anything should be able
# to be put here including bad math and commands
SET $BADVAR = $BADVAR + 1
DOBADTHINGS
FI
MAN
TEXT /MAKE/USR/SHARE/TESTS/SKIPBLOCK

View File

@ -8,7 +8,7 @@ AUTO 4,1
#
ECHO "\f A2osX Test System Menu\n"
ECHO " 1) Core Tests"
ECHO " 2) Display Tests (Echo and Read)"
ECHO " B) Display Tests (Echo and Read)"
ECHO " 3) Pathing Tests (CD PWD POPD PUSHD)"
ECHO " 4) Internal Command Tests"
ECHO " 5) External Command Tests"
@ -18,10 +18,10 @@ ECHO " 8) Display Logs\n"
ECHO " 9) Build Test Suite with Logging"
ECHO "\n"
READ -P "Enter Choice: " Z
IF [ $Z = "1" ]
IF [ $Z -EQ 1 ]
CORETEST
ELSE
IF [ $Z = "2" ]
IF [ $Z = "B" ]
DISPLAYTEST
ELSE
IF [ $Z = "3" ]