aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMoritz Meißelbach <arbelzapf@gmail.com>2019-10-24 21:45:44 +0200
committerMoritz Meißelbach <arbelzapf@gmail.com>2019-10-24 21:45:44 +0200
commit9721c1a03e9734bae358217f81cfbb287e4a0f30 (patch)
treef2496e5826f5a1021f9400b4b592f911eb80ad0f
parent71d526589f8e7ad8bf92a8e78c34c7af5e1497cb (diff)
downloadsway-launcher-desktop-9721c1a03e9734bae358217f81cfbb287e4a0f30.tar.gz
sway-launcher-desktop-9721c1a03e9734bae358217f81cfbb287e4a0f30.zip
Add test cases for 2 more desktop files. Add a space in the launcher script for aesthetics
-rwxr-xr-xsway-launcher-desktop.sh2
-rw-r--r--tests/generate-command.bats12
2 files changed, 13 insertions, 1 deletions
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