Changeset View
Changeset View
Standalone View
Standalone View
src/tests/dolphinsearchboxtest.cpp
Show First 20 Lines • Show All 160 Lines • ▼ Show 20 Line(s) | 158 | { | |||
---|---|---|---|---|---|
161 | QFETCH(QStringList, expectedTerms); | 161 | QFETCH(QStringList, expectedTerms); | ||
162 | 162 | | |||
163 | QUrl testUrl = _composeQueryUrl(searchString); | 163 | QUrl testUrl = _composeQueryUrl(searchString); | ||
164 | DolphinQueryModel queryModel = DolphinQueryModel::fromBalooSearchUrl(testUrl); | 164 | DolphinQueryModel queryModel = DolphinQueryModel::fromBalooSearchUrl(testUrl); | ||
165 | 165 | | |||
166 | QStringList searchTerms = queryModel.searchTerms(); | 166 | QStringList searchTerms = queryModel.searchTerms(); | ||
167 | searchTerms.sort(); | 167 | searchTerms.sort(); | ||
168 | 168 | | |||
169 | // FIXME: Current parsing bugs | | |||
170 | QEXPECT_FAIL("content/singleQuote", "Quotes around text are shown", Continue); | | |||
171 | QEXPECT_FAIL("content/doubleQuote", "Quotes around text are shown", Continue); | | |||
172 | | ||||
173 | QEXPECT_FAIL("filename", "Quotes around text are shown", Continue); | | |||
174 | QEXPECT_FAIL("filename/singleQuote", "Quotes around text are shown", Continue); | | |||
175 | QEXPECT_FAIL("filename/doubleQuote", "Quotes around text are shown", Continue); | | |||
176 | | ||||
177 | QEXPECT_FAIL("rating" , "Text includes also search terms", Continue); | | |||
178 | QEXPECT_FAIL("rating+content" , "Text includes also search terms", Continue); | | |||
179 | QEXPECT_FAIL("rating+filename" , "Text includes also search terms", Continue); | | |||
180 | QEXPECT_FAIL("modified" , "Text includes also search terms", Continue); | | |||
181 | QEXPECT_FAIL("modified+content" , "Text includes also search terms", Continue); | | |||
182 | QEXPECT_FAIL("modified+filename" , "Text includes also search terms", Continue); | | |||
183 | QEXPECT_FAIL("rating+modified" , "Text includes also search terms", Continue); | | |||
184 | QEXPECT_FAIL("rating+modified+content" , "Text includes also search terms", Continue); | | |||
185 | QEXPECT_FAIL("rating+modified+filename", "Text includes also search terms", Continue); | | |||
186 | | ||||
187 | // Check for parsed text (would be displayed on the input search bar) | 169 | // Check for parsed text (would be displayed on the input search bar) | ||
188 | QCOMPARE(queryModel.text(), expectedText); | 170 | QCOMPARE(queryModel.text(), expectedText); | ||
189 | 171 | | |||
190 | // Check for parsed search terms (would be displayed by the facetsWidget) | 172 | // Check for parsed search terms (would be displayed by the facetsWidget) | ||
191 | QCOMPARE(searchTerms.count(), expectedTerms.count()); | 173 | QCOMPARE(searchTerms.count(), expectedTerms.count()); | ||
192 | for (int i=0; i < expectedTerms.count(); i++) { | 174 | for (int i=0; i < expectedTerms.count(); i++) { | ||
193 | QCOMPARE(searchTerms.at(i).trimmed(), expectedTerms.at(i).trimmed()); | 175 | QCOMPARE(searchTerms.at(i).trimmed(), expectedTerms.at(i).trimmed()); | ||
194 | } | 176 | } | ||
195 | } | 177 | } | ||
196 | #endif //HAVE_BALOO | 178 | #endif //HAVE_BALOO | ||
197 | 179 | | |||
198 | QTEST_MAIN(DolphinSearchBoxTest) | 180 | QTEST_MAIN(DolphinSearchBoxTest) | ||
199 | 181 | | |||
200 | #include "dolphinsearchboxtest.moc" | 182 | #include "dolphinsearchboxtest.moc" |