@test "simple test" {
bats_require_minimum_version 1.5.0
run --keep-empty-lines echo 'hello'
assert_success
echo "Line count: ${#lines[@]}"
[ "${#lines[@]}" -eq 1 ]
assert_line -n 0 'hello'
assert_line -n 1 ''
assert_line -n 2 ''
assert_line -n 99 ''
}
I would expect asserting lines that do not exist to fail, even though we assert them with '' (empty string).
Shouldn't there be some sort of automatic check that looks if the line id you're asserting is >= line count when using assert_line ?