Added primitive unit testing.
This commit is contained in:
parent
85cc542d74
commit
8026138b9c
8 changed files with 180 additions and 63 deletions
13
unit-tests/empty-string.sh
Normal file
13
unit-tests/empty-string.sh
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
expected="\"\""
|
||||
actual=`echo '""' | target/psse 2> /dev/null`
|
||||
|
||||
if [ "$expected" = "$actual" ]
|
||||
then
|
||||
echo "OK"
|
||||
exit 0
|
||||
else
|
||||
echo "Expected '$expected', got '$actual'"
|
||||
exit 1
|
||||
fi
|
||||
13
unit-tests/fred.sh
Normal file
13
unit-tests/fred.sh
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
expected=\"Fred\"
|
||||
actual=`echo '"Fred"' | target/psse 2> /dev/null`
|
||||
|
||||
if [ "$expected" = "$actual" ]
|
||||
then
|
||||
echo "OK"
|
||||
exit 0
|
||||
else
|
||||
echo "Expected '$expected', got '$actual'"
|
||||
exit 1
|
||||
fi
|
||||
13
unit-tests/nil.sh
Normal file
13
unit-tests/nil.sh
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
expected=NIL
|
||||
actual=`echo '()' | target/psse 2> /dev/null`
|
||||
|
||||
if [ "${expected}" = "${actual}" ]
|
||||
then
|
||||
echo "OK"
|
||||
exit 0
|
||||
else
|
||||
echo "Expected '${expected}', got '${actual}'"
|
||||
exit 1
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue