From fe41442f90cb53274540e159f7cfbda4335a5841 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Mon, 22 Jun 2020 22:57:16 +0200 Subject: #23 add (failing) test case for this PR --- .../0/applications/Sid Meier's Civilization IV.desktop | 8 ++++++++ tests/describe.bats | 7 +++++++ 2 files changed, 15 insertions(+) create mode 100644 tests/data/desktop-files/0/applications/Sid Meier's Civilization IV.desktop 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..aac8eff --- /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=Official Minecraft Launcher +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..00aa3dc 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]} =~ "Firefox" ]] + [[ ${lines[1]} =~ "Browse the World Wide Web" ]] +} + @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 ] -- cgit v1.2.3