[test of words]
options=-w
input=one two three
output=3
[test of characters]
options=-c
input=one two three
output=13
$ some-utility --tests=wc_tests.--ini command=wc
#!/usr/bin/env bats
@test "a test of words" {
result="`printf 'one two three' | wc-w`"
[[ "$result" == 3 ]]
}
@test "a test of characters" {
result="`printf 'one two three' | wc-c`"
[[ "$result" == 13 ]]
}
$ bats test.bats
✓ test of words
✓ test of characters
2 tests, 0 failures
Find more questions by tags Modular testing