This is a slowly growing collection of hopefully useful and reusable shell functions and patterns. https://code.jan.io/jan/jans_shell_utils
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

test_assert_arg.sh 450B

3 yıl önce
1234567891011121314151617181920212223242526272829303132
  1. #!/bin/sh
  2. . ../lib.sh
  3. echo "testing assert_arg"
  4. global_error=0
  5. expect=1
  6. result=`assert_arg`
  7. if [ $? -ne $expect ]; then
  8. echo "assert_arg with no parameter fails"
  9. global_error=1
  10. fi
  11. echo .
  12. expect=0
  13. result=`assert_arg foo`
  14. if [ $? -ne $expect ]; then
  15. echo "assert_arg with parameter does not pass"
  16. global_error=1
  17. echo .
  18. fi
  19. echo .
  20. if [ $global_error -ne 0 ]; then
  21. echo "one or more tests failed"
  22. exit 1
  23. else
  24. echo "all tests pass"
  25. exit 0
  26. fi