2023-08-06 15:57:01 +02:00
|
|
|
#include "util/XDGDesktopFile.hpp"
|
|
|
|
|
2024-05-05 15:01:07 +02:00
|
|
|
#include "Test.hpp"
|
|
|
|
|
2023-08-06 15:57:01 +02:00
|
|
|
#include <QDebug>
|
|
|
|
|
2023-08-21 19:00:37 +02:00
|
|
|
#if defined(Q_OS_UNIX) and !defined(Q_OS_DARWIN)
|
|
|
|
|
2023-08-06 15:57:01 +02:00
|
|
|
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);
|
|
|
|
}
|
2023-08-21 19:00:37 +02:00
|
|
|
|
|
|
|
#endif
|