awesome-compose/lib/bats-support/test/50-output-11-batslib_count_lines.bats
Chad Metcalf 6565a1f745
Vendoring bats libraries.
Signed-off-by: Chad Metcalf <chad@docker.com>
2020-08-08 14:27:13 -07:00

22 lines
540 B
Bash
Executable File

#!/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' ]
}