我正在 exercism.io 上尝试 bash 课程 https://exercism.io/my/solutions/8d68ead0c1ad4caabf25410806ade766
我已经安装了练习文件,安装了 bats,当我运行测试时:bats hello_world_test.sh
它输出和错误:
$ bats hello_world_test.sh
✗ Say Hi!
(in test file hello_world_test.sh, line 6)
`[ "$status" -eq 0 ]' failed
bats hello_world_test.sh 的代码是:
#!/usr/bin/env bash
@test "Say Hi!" {
run bash hello_world.sh
[ "$status" -eq 0 ]
[ "$output" = "Hello, World!" ]
}