Changeset View
Changeset View
Standalone View
Standalone View
src/tests/dolphinquerytest.cpp
Show First 20 Lines • Show All 108 Lines • ▼ Show 20 Line(s) | 106 | { | |||
---|---|---|---|---|---|
109 | QFETCH(QStringList, expectedTerms); | 109 | QFETCH(QStringList, expectedTerms); | ||
110 | 110 | | |||
111 | const QUrl testUrl = composeQueryUrl(searchString); | 111 | const QUrl testUrl = composeQueryUrl(searchString); | ||
112 | const DolphinQuery query = DolphinQuery::fromBalooSearchUrl(testUrl); | 112 | const DolphinQuery query = DolphinQuery::fromBalooSearchUrl(testUrl); | ||
113 | 113 | | |||
114 | QStringList searchTerms = query.searchTerms(); | 114 | QStringList searchTerms = query.searchTerms(); | ||
115 | searchTerms.sort(); | 115 | searchTerms.sort(); | ||
116 | 116 | | |||
117 | // FIXME: Current parsing bugs | | |||
118 | QEXPECT_FAIL("content/singleQuote", "Quotes around text are shown", Continue); | | |||
119 | QEXPECT_FAIL("content/doubleQuote", "Quotes around text are shown", Continue); | | |||
120 | | ||||
121 | QEXPECT_FAIL("filename", "Quotes around text are shown", Continue); | | |||
122 | QEXPECT_FAIL("filename/singleQuote", "Quotes around text are shown", Continue); | | |||
123 | QEXPECT_FAIL("filename/doubleQuote", "Quotes around text are shown", Continue); | | |||
124 | | ||||
125 | QEXPECT_FAIL("rating" , "Text includes also search terms", Continue); | | |||
126 | QEXPECT_FAIL("rating+content" , "Text includes also search terms", Continue); | | |||
127 | QEXPECT_FAIL("rating+filename" , "Text includes also search terms", Continue); | | |||
128 | QEXPECT_FAIL("modified" , "Text includes also search terms", Continue); | | |||
129 | QEXPECT_FAIL("modified+content" , "Text includes also search terms", Continue); | | |||
130 | QEXPECT_FAIL("modified+filename" , "Text includes also search terms", Continue); | | |||
131 | QEXPECT_FAIL("rating+modified" , "Text includes also search terms", Continue); | | |||
132 | QEXPECT_FAIL("rating+modified+content" , "Text includes also search terms", Continue); | | |||
133 | QEXPECT_FAIL("rating+modified+filename", "Text includes also search terms", Continue); | | |||
134 | | ||||
135 | // Check for parsed text (would be displayed on the input search bar) | 117 | // Check for parsed text (would be displayed on the input search bar) | ||
136 | QCOMPARE(query.text(), expectedText); | 118 | QCOMPARE(query.text(), expectedText); | ||
137 | 119 | | |||
138 | // Check for parsed search terms (would be displayed by the facetsWidget) | 120 | // Check for parsed search terms (would be displayed by the facetsWidget) | ||
139 | QCOMPARE(searchTerms.count(), expectedTerms.count()); | 121 | QCOMPARE(searchTerms.count(), expectedTerms.count()); | ||
140 | for (int i = 0; i < expectedTerms.count(); i++) { | 122 | for (int i = 0; i < expectedTerms.count(); i++) { | ||
141 | QCOMPARE(searchTerms.at(i), expectedTerms.at(i)); | 123 | QCOMPARE(searchTerms.at(i), expectedTerms.at(i)); | ||
142 | } | 124 | } | ||
143 | } | 125 | } | ||
144 | 126 | | |||
145 | QTEST_MAIN(DolphinSearchBoxTest) | 127 | QTEST_MAIN(DolphinSearchBoxTest) | ||
146 | 128 | | |||
147 | #include "dolphinquerytest.moc" | 129 | #include "dolphinquerytest.moc" |