Skip to content

Commit

Permalink
TestCMDLineAssembler: Add test for Distrobox
Browse files Browse the repository at this point in the history
  • Loading branch information
meator committed Nov 23, 2024
1 parent 0955300 commit 1a82def
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/TestCMDLineAssembler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,21 @@ TEST_CASE("Test desktop files with superfluous whitespace in Exec",
std::vector<std::string>{"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<std::string>{
"/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;
Expand Down
15 changes: 15 additions & 0 deletions tests/test_files/applications/alpine-toolbox-latest-feh.desktop
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 1a82def

Please sign in to comment.