Nav apraksta
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

output.bats 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/usr/bin/env bats
  2. @test "task1: Check that we have a debug output" {
  3. run stat "$BATS_TEST_DIRNAME/../target/debug/task1"
  4. [ "$status" -eq 0 ]
  5. }
  6. # wc output with white spaces is trimmed by xargs
  7. @test "task1: Output with no param must be exact 5 line long" {
  8. run bash -c "'$BATS_TEST_DIRNAME/../target/debug/task1' | wc -l | xargs"
  9. [ "$output" = "5" ]
  10. }
  11. # wc output with white spaces is trimmed by xargs
  12. @test "task1: Output with to many paras must be exact 1 line long" {
  13. run bash -c "'$BATS_TEST_DIRNAME/../target/debug/task1' 2 3 | wc -l | xargs"
  14. [ "$output" = "1" ]
  15. }
  16. # wc output with white spaces is trimmed by xargs
  17. @test "task1: Output with wrong para must be exact 1 line long" {
  18. run bash -c "'$BATS_TEST_DIRNAME/../target/debug/task1' b | wc -l | xargs"
  19. [ "$output" = "1" ]
  20. }
  21. @test "task1: Output with wrong PID does not crash" {
  22. run bash -c "'$BATS_TEST_DIRNAME/../target/debug/task1' 2 "
  23. [ "$status" = 1 ]
  24. }
  25. @test "task1: Output with wrong PARAM does not crash" {
  26. run bash -c "'$BATS_TEST_DIRNAME/../target/debug/task1' a "
  27. [ "$status" = 1 ]
  28. }
  29. @test "task1: Output with to many para does not crash" {
  30. run bash -c "'$BATS_TEST_DIRNAME/../target/debug/task1' 2 3 "
  31. [ "$status" = 1 ]
  32. }