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