This commit is contained in:
2026-08-02 15:26:07 +02:00
parent 336b36c8e1
commit b2eb145a6f
415 changed files with 24264 additions and 36 deletions
@@ -0,0 +1,21 @@
#!/usr/bin/env bats
load test_helper
@test 'batslib_count_lines() <string>: displays the number of lines in <string>' {
run batslib_count_lines $'a\nb\nc\n'
[ "$status" -eq 0 ]
[ "$output" == '3' ]
}
@test 'batslib_count_lines() <string>: counts the last line when it is not terminated by a newline' {
run batslib_count_lines $'a\nb\nc'
[ "$status" -eq 0 ]
[ "$output" == '3' ]
}
@test 'batslib_count_lines() <string>: counts empty lines' {
run batslib_count_lines $'\n\n\n'
[ "$status" -eq 0 ]
[ "$output" == '3' ]
}