Procházet zdrojové kódy

add a little test

main
Jan Lehnardt před 3 roky
rodič
revize
1432410974
2 změnil soubory, kde provedl 37 přidání a 5 odebrání
  1. +5
    -5
      test/test.sh
  2. +32
    -0
      test/test_assert_arg.sh

test.sh → test/test.sh Zobrazit soubor

@@ -19,8 +19,8 @@
# echo


. ./wait_for_pid_exit.sh
echo test5
(wait_for_pid_exit 45591 4 17)
echo "test5 done"
# . ./wait_for_pid_exit.sh
#
# echo test5
# (wait_for_pid_exit 45591 4 17)
# echo "test5 done"

+ 32
- 0
test/test_assert_arg.sh Zobrazit soubor

@@ -0,0 +1,32 @@
#!/bin/sh

. ../lib.sh

echo "testing assert_arg"

global_error=0

expect=1
result=`assert_arg`
if [ $? -ne $expect ]; then
echo "assert_arg with no parameter fails"
global_error=1
fi
echo .

expect=0
result=`assert_arg foo`
if [ $? -ne $expect ]; then
echo "assert_arg with parameter does not pass"
global_error=1
echo .
fi
echo .

if [ $global_error -ne 0 ]; then
echo "one or more tests failed"
exit 1
else
echo "all tests pass"
exit 0
fi

Načítá se…
Zrušit
Uložit