Added more unit tests.
This commit is contained in:
parent
8026138b9c
commit
6eab3a531a
|
@ -13,7 +13,7 @@ fail=0
|
|||
|
||||
for file in unit-tests/*
|
||||
do
|
||||
echo ${file}
|
||||
echo -n "${file} => "
|
||||
bash ${file}
|
||||
|
||||
if [ $? -eq 0 ]
|
||||
|
|
|
@ -8,6 +8,6 @@ then
|
|||
echo "OK"
|
||||
exit 0
|
||||
else
|
||||
echo "Expected '$expected', got '$actual'"
|
||||
echo "Fail: expected '$expected', got '$actual'"
|
||||
exit 1
|
||||
fi
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
expected=\"Fred\"
|
||||
actual=`echo '"Fred"' | target/psse 2> /dev/null`
|
||||
actual=`echo ${expected} | target/psse 2> /dev/null`
|
||||
|
||||
if [ "$expected" = "$actual" ]
|
||||
if [ "${expected}" = "{$actual}" ]
|
||||
then
|
||||
echo "OK"
|
||||
exit 0
|
||||
else
|
||||
echo "Expected '$expected', got '$actual'"
|
||||
echo "Fail: expected '$expected', got '$actual'"
|
||||
exit 1
|
||||
fi
|
||||
|
|
14
unit-tests/integer-allocation.sh
Normal file
14
unit-tests/integer-allocation.sh
Normal file
|
@ -0,0 +1,14 @@
|
|||
#!/bin/bash
|
||||
|
||||
value=354
|
||||
expected="Integer cell: value ${value}"
|
||||
echo ${value} | target/psse 2>&1 | grep "${expected}" > /dev/null
|
||||
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
echo "OK"
|
||||
exit 0
|
||||
else
|
||||
echo "Expected '${expected}', not found"
|
||||
exit 1
|
||||
fi
|
13
unit-tests/integer.sh
Normal file
13
unit-tests/integer.sh
Normal file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
expected="354"
|
||||
actual=`echo ${expected} | target/psse 2> /dev/null`
|
||||
|
||||
if [ "${expected}" = "${actual}" ]
|
||||
then
|
||||
echo "OK"
|
||||
exit 0
|
||||
else
|
||||
echo "Expected '${expected}', got '${actual}'"
|
||||
exit 1
|
||||
fi
|
|
@ -8,6 +8,6 @@ then
|
|||
echo "OK"
|
||||
exit 0
|
||||
else
|
||||
echo "Expected '${expected}', got '${actual}'"
|
||||
echo "Fail: expected '${expected}', got '${actual}'"
|
||||
exit 1
|
||||
fi
|
||||
|
|
13
unit-tests/simple-list.sh
Normal file
13
unit-tests/simple-list.sh
Normal file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
expected="(1 2 3)"
|
||||
actual=`echo '(1 2 3)' | target/psse 2> /dev/null`
|
||||
|
||||
if [ "${expected}" = "${actual}" ]
|
||||
then
|
||||
echo "OK"
|
||||
exit 0
|
||||
else
|
||||
echo "Fail: expected '${expected}', got '${actual}'"
|
||||
exit 1
|
||||
fi
|
13
unit-tests/string-with-spaces.sh
Normal file
13
unit-tests/string-with-spaces.sh
Normal file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
expected="\"Strings should be able to include spaces (and other stuff)!\""
|
||||
actual=`echo ${expected} | target/psse 2> /dev/null`
|
||||
|
||||
if [ "${expected}" = "{$actual}" ]
|
||||
then
|
||||
echo "OK"
|
||||
exit 0
|
||||
else
|
||||
echo "Fail: expected '$expected', got '$actual'"
|
||||
exit 1
|
||||
fi
|
Loading…
Reference in a new issue