aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/data/desktop-files/0/applications/Sid Meier's Civilization IV.desktop8
-rw-r--r--tests/describe.bats7
-rw-r--r--tests/entries.bats4
3 files changed, 17 insertions, 2 deletions
diff --git a/tests/data/desktop-files/0/applications/Sid Meier's Civilization IV.desktop b/tests/data/desktop-files/0/applications/Sid Meier's Civilization IV.desktop
new file mode 100644
index 0000000..fbffa76
--- /dev/null
+++ b/tests/data/desktop-files/0/applications/Sid Meier's Civilization IV.desktop
@@ -0,0 +1,8 @@
+[Desktop Entry]
+Type=Application
+Version=1.0
+Name=Sid Meier's Civilization IV
+Comment=Play Civ5
+Exec=echo foo
+Terminal=false
+Categories=Game;Application; \ No newline at end of file
diff --git a/tests/describe.bats b/tests/describe.bats
index 1541974..1ac58ff 100644
--- a/tests/describe.bats
+++ b/tests/describe.bats
@@ -5,6 +5,13 @@
[[ ${lines[1]} =~ "Browse the World Wide Web" ]]
}
+@test "Desktop file names containing single quotes can be processed" {
+ run env XDG_CONFIG_HOME=./data/config ../sway-launcher-desktop.sh describe desktop "./data/desktop-files/0/applications/Sid Meier's Civilization IV.desktop"
+ [ "$status" -eq 0 ]
+ [[ ${lines[0]} =~ "Sid Meier's Civilization IV" ]]
+ [[ ${lines[1]} =~ "Play Civ5" ]]
+}
+
@test "Name and description of ls command should be given" {
run env XDG_CONFIG_HOME=./data/config ../sway-launcher-desktop.sh describe command ls
[ "$status" -eq 0 ]
diff --git a/tests/entries.bats b/tests/entries.bats
index de18891..e6781ed 100644
--- a/tests/entries.bats
+++ b/tests/entries.bats
@@ -11,12 +11,12 @@
@test "Wildcard expansion works for extraction of desktop files" {
run ../sway-launcher-desktop.sh entries data/desktop-files/0/applications/*.desktop
[ "$status" -eq 0 ]
- [[ ${#lines[@]} == 5 ]]
+ [[ ${#lines[@]} == 6 ]]
}
@test "Reoccurring desktop file ids are not parsed twice" {
run ../sway-launcher-desktop.sh entries data/desktop-files/**/*.desktop
echo "EXPECTED: foo-bar.desktop ACTUAL: $output"
[ "$status" -eq 0 ]
- [[ ${#lines[@]} == 5 ]]
+ [[ ${#lines[@]} == 6 ]]
} \ No newline at end of file