Re:Testing Bash with BATS
by tomeon on Thursday February 21, 2019 @06:09PM
(#19221525)
> I don't know how bats works with the @test annotation? That doesn't look like valid shell syntax.
Bats runs the test files through a preprocessor[1] that, among other things, converts each `@test` case into a shell function. E.g. `@test "the doohickey should frob" { ... }` becomes `test_the_doohickey_should_frob() { ... }`.
Bats runs the test files through a preprocessor[1] that, among other things, converts each `@test` case into a shell function. E.g. `@test "the doohickey should frob" { ... }` becomes `test_the_doohickey_should_frob() { ... }`.
[1] https://github.com/bats-core/bats-core/blob/master/libexec/b...