mirror-chatterino2/tests/src/XDGDesktopFile.cpp
nerix ea30c3a619
Fix XDG tests on Windows (#4779)
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
2023-08-21 17:00:37 +00:00

23 lines
543 B
C++

#include "util/XDGDesktopFile.hpp"
#include <gtest/gtest.h>
#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