16 template<
typename K,
typename V>
22 return qstrdup (str.toUtf8 ().constData ());
29 return { { {}, { val } } };
32 void DesktopParserTest::testBasicFile ()
35 const auto& res = p (R
"( 38 Comment=This session logs you into your custom Xsession 47 {
"Comment",
SingleValue (
"This session logs you into your custom Xsession") },
52 QCOMPARE (res, expected);
55 void DesktopParserTest::testComments ()
58 const auto& res = p (R
"( 61 Comment=This session logs you into your custom Xsession 62 # no icon yet, only the top three are currently used 71 {
"Comment",
SingleValue (
"This session logs you into your custom Xsession") },
76 QCOMPARE (res, expected);
79 void DesktopParserTest::testLists ()
82 const auto& res = p (R
"( 84 Name=XSession;xsession;XSESSION 85 Comment=This session logs you into your custom Xsession 93 {
"Name", { { {}, {
"XSession",
"xsession",
"XSESSION" } } } },
94 {
"Comment",
SingleValue (
"This session logs you into your custom Xsession") },
99 QCOMPARE (res, expected);
102 void DesktopParserTest::testLangs ()
105 const auto& res = p (R
"( 110 Comment=This session logs you into your custom Xsession 121 { {}, {
"XSession", } },
122 { {
"en" }, {
"xsession" } },
123 { {
"ru" }, {
"XSESSION" } },
126 {
"Comment",
SingleValue (
"This session logs you into your custom Xsession") },
131 QCOMPARE (res, expected);
QHash< QString, QStringList > LangValue_t
Mapping from a language to the list of values for that language.
QHash< QString, Group_t > Result_t
Mapping from a group name to the group itself.
char * toString(const QHash< K, V > &hash)
DesktopParser::LangValue_t SingleValue(const QString &val)