From abcb891359649559981d0ef522ed16ddf2b68908 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Thu, 31 Oct 2019 21:40:32 +0100 Subject: Generate a spec-conformant "desktop file id" of each .desktop file and remove duplicates. This should process user-specific overrides properly #3 --- tests/entries.bats | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'tests/entries.bats') diff --git a/tests/entries.bats b/tests/entries.bats index 304dc6a..de18891 100644 --- a/tests/entries.bats +++ b/tests/entries.bats @@ -1,14 +1,22 @@ @test "Firefox desktop entry and all its actions are extracted" { - run ../sway-launcher-desktop.sh entries data/firefox.desktop + run ../sway-launcher-desktop.sh entries data/desktop-files/0/applications/firefox.desktop + echo -e "OUTPUT:\n$output" [ "$status" -eq 0 ] - [[ ${lines[0]} =~ data/firefox.desktop ]] - [[ ${lines[0]} =~ ^data/firefox.desktop.*Firefox ]] - [[ ${lines[1]} =~ ^data/firefox.desktop.*Firefox.*(New Window).*new-window ]] - [[ ${lines[2]} =~ ^data/firefox.desktop.*Firefox.*(New Private Window).*new-private-window ]] + [[ ${lines[0]} =~ data/desktop-files/0/applications/firefox.desktop ]] + [[ ${lines[0]} =~ ^data/desktop-files/0/applications/firefox.desktop.*Firefox ]] + [[ ${lines[1]} =~ ^data/desktop-files/0/applications/firefox.desktop.*Firefox.*(New Window).*new-window ]] + [[ ${lines[2]} =~ ^data/desktop-files/0/applications/firefox.desktop.*Firefox.*(New Private Window).*new-private-window ]] } @test "Wildcard expansion works for extraction of desktop files" { - run ../sway-launcher-desktop.sh entries data/*.desktop + run ../sway-launcher-desktop.sh entries data/desktop-files/0/applications/*.desktop + [ "$status" -eq 0 ] + [[ ${#lines[@]} == 5 ]] +} + +@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 ]] } \ No newline at end of file -- cgit v1.2.3