From 9721c1a03e9734bae358217f81cfbb287e4a0f30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Thu, 24 Oct 2019 21:45:44 +0200 Subject: Add test cases for 2 more desktop files. Add a space in the launcher script for aesthetics --- sway-launcher-desktop.sh | 2 +- tests/generate-command.bats | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/sway-launcher-desktop.sh b/sway-launcher-desktop.sh index cf6b359..4f59666 100755 --- a/sway-launcher-desktop.sh +++ b/sway-launcher-desktop.sh @@ -108,7 +108,7 @@ if [[ "$1" == 'generate-command' ]]; then END{ if(path){ - printf "cd " path " &&" + printf "cd " path " && " } if (terminal){ printf terminal_command " " diff --git a/tests/generate-command.bats b/tests/generate-command.bats index 780c963..f078946 100644 --- a/tests/generate-command.bats +++ b/tests/generate-command.bats @@ -2,4 +2,16 @@ run ../sway-launcher-desktop.sh generate-command data/firefox.desktop [ "$status" -eq 0 ] [[ "$output" == '/usr/lib/firefox/firefox' ]] +} + +@test "Exec command is properly generated from htop desktop file" { + run ../sway-launcher-desktop.sh generate-command data/htop.desktop + [ "$status" -eq 0 ] + [[ "$output" == 'termite -e htop' ]] +} + +@test "Exec command is properly generated from minecraft-launcher desktop file" { + run ../sway-launcher-desktop.sh generate-command data/minecraft-launcher.desktop + [ "$status" -eq 0 ] + [[ "$output" == 'cd /opt/minecraft-launcher/ && env GDK_BACKEND=x11 /opt/minecraft-launcher/minecraft-launcher' ]] } \ No newline at end of file -- cgit v1.2.3