Нет описания
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

output.bats 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #!/usr/bin/env bats
  2. load test_helper
  3. @test "task1: Check that we have a debug output" {
  4. run stat "$BATS_TEST_DIRNAME/../target/debug/task1"
  5. [ "$status" -eq 0 ]
  6. }
  7. # Check lines of output
  8. # wc output with white spaces is trimmed by xargs
  9. @test "task1: Error Output must at least 8 Lines long" {
  10. run bash -c "'$BATS_TEST_DIRNAME/../target/debug/task1' 2>&1 | wc -l | xargs"
  11. assert_range 8 6 10
  12. }
  13. # wc output with white correct input is trimmed by xargs
  14. @test "task1: Normal Output must be at least 4 line long" {
  15. run bash -c "'$BATS_TEST_DIRNAME/../target/debug/task1' 42 123 | wc -l | xargs"
  16. assert_range 4 4 6
  17. }
  18. # wc output with white correct input is trimmed by xargs
  19. @test "task1: Help Output must be at least 18 line long" {
  20. run bash -c "'$BATS_TEST_DIRNAME/../target/debug/task1' -- --help | wc -l | xargs"
  21. assert_range 18 18 20
  22. }
  23. # timeout loop
  24. @test "task1: Output with wrong pattern" {
  25. run timeout 2 bash -c "'$BATS_TEST_DIRNAME/../target/debug/task1' 42 j "
  26. no_timeout_fail
  27. }
  28. # Status checks
  29. @test "task1: Output with wrong input paras does not crash" {
  30. run bash -c "'$BATS_TEST_DIRNAME/../target/debug/task1' x y z "
  31. assert_fail
  32. }
  33. @test "task1: Output with wrong PARAM does not crash" {
  34. run bash -c "'$BATS_TEST_DIRNAME/../target/debug/task1' a a"
  35. assert_fail
  36. }
  37. #@test "task1: Output with wrong pattern does not crash" {
  38. # run bash -c "'$BATS_TEST_DIRNAME/../target/debug/task1' 2 a "
  39. # assert_fail
  40. #}