diff --git a/tests/TestCMDLineAssembler.cc b/tests/TestCMDLineAssembler.cc index f149936..872de0b 100644 --- a/tests/TestCMDLineAssembler.cc +++ b/tests/TestCMDLineAssembler.cc @@ -181,6 +181,21 @@ TEST_CASE("Test desktop files with superfluous whitespace in Exec", std::vector{"eagle", "", "-style", "", "", "plastique"}); } +TEST_CASE("Test Distrobox compatibility", "[CMDLineAssembler]") { + LocaleSuffixes ls("en_US"); + LineReader liner; + + Application app(TEST_FILES "applications/alpine-toolbox-latest-feh.desktop", + liner, ls, {}); + + auto split_exec = + CMDLineAssembly::convert_exec_to_command(app.exec, {false, true}); + REQUIRE(split_exec == std::vector{ + "/home/meator/distrobox-1.8.0/distrobox-enter", + "-n", "alpine-toolbox-latest", "--", "feh", + "--start-at", "%u"}); +} + TEST_CASE("Test wine and multispace quirk", "[CMDLineAssembler]") { LocaleSuffixes ls("en_US"); LineReader liner; diff --git a/tests/test_files/applications/alpine-toolbox-latest-feh.desktop b/tests/test_files/applications/alpine-toolbox-latest-feh.desktop new file mode 100644 index 0000000..b25f0e7 --- /dev/null +++ b/tests/test_files/applications/alpine-toolbox-latest-feh.desktop @@ -0,0 +1,15 @@ +# This file was generated by distrobox-export. +[Desktop Entry] +Name=Feh (on alpine-toolbox-latest) +Name[en_US]=feh (on alpine-toolbox-latest) +GenericName=Image viewer (on alpine-toolbox-latest) +GenericName[en_US]=Image viewer (on alpine-toolbox-latest) +Comment=Image viewer and cataloguer +Exec=/home/meator/distrobox-1.8.0/distrobox-enter -n alpine-toolbox-latest -- feh --start-at %u +Terminal=false +Type=Application +Icon=feh +Categories=Graphics;2DGraphics;Viewer; +MimeType=image/bmp;image/gif;image/jpeg;image/jpg;image/pjpeg;image/png;image/tiff;image/webp;image/x-bmp;image/x-pcx;image/x-png;image/x-portable-anymap;image/x-portable-bitmap;image/x-portable-graymap;image/x-portable-pixmap;image/x-tga;image/x-xbitmap;image/heic; +#NoDisplay=true +StartupWMClass=feh