🧪 Add tests for -n newline toggle option

This commit is contained in:
Marty Oehme 2022-09-22 22:47:00 +02:00
parent 7c2af88233
commit 94110cda3e
Signed by: Marty
GPG Key ID: 73BA40D5AFAF49C9
1 changed files with 12 additions and 0 deletions

View File

@ -63,3 +63,15 @@ typing result"
BEMOJI_DEFAULT_CMD="echo my custom command" BEMOJI_CLIP_CMD="echo my clipping" run bemoji -c 3>&-
assert_output "my clipping"
}
@test "Prints output with newline by default" {
bats_require_minimum_version 1.5.0
BEMOJI_PICKER_CMD="echo heart" run --keep-empty-lines -- bemoji -e
assert_output --regexp '^heart\n$'
}
@test "Prints output without newline on -n option" {
bats_require_minimum_version 1.5.0
BEMOJI_PICKER_CMD="echo heart" run --keep-empty-lines -- bemoji -ne
assert_output --regexp '^heart$'
}