mirror-chatterino2/tests/src/XDGDesktopFile.cpp
pajlada 401feac0aa
tests: better test initializing allowing for better printing (#5379)
Co-authored-by: Nerixyz <nerixdev@outlook.de>
2024-05-05 13:01:07 +00:00

24 lines
539 B
C++

#include "util/XDGDesktopFile.hpp"
#include "Test.hpp"
#include <QDebug>
#if defined(Q_OS_UNIX) and !defined(Q_OS_DARWIN)
using namespace chatterino;
TEST(XDGDesktopFile, String)
{
auto desktopFile = XDGDesktopFile(":/001-mimeapps.list");
auto entries = desktopFile.getEntries("Default Applications");
ASSERT_EQ(entries["thisshould"], "");
ASSERT_EQ(entries["lol"], "");
ASSERT_EQ(entries["x-scheme-handler/http"], QString("firefox.desktop"));
ASSERT_EQ(desktopFile.getEntries("test").size(), 2);
}
#endif