Changeset View
Changeset View
Standalone View
Standalone View
plugins/quickopen/tests/test_quickopen.cpp
Show First 20 Lines • Show All 241 Lines • ▼ Show 20 Line(s) | 241 | const StringList b = { | |||
---|---|---|---|---|---|
242 | QStringLiteral("/home/user/src/code/home/else"), | 242 | QStringLiteral("/home/user/src/code/home/else"), | ||
243 | QStringLiteral("/home/user/src/code/user/something"), | 243 | QStringLiteral("/home/user/src/code/user/something"), | ||
244 | }; | 244 | }; | ||
245 | QTest::newRow("prefer_multimatch_a_home") << a << QStringLiteral("home") << b; | 245 | QTest::newRow("prefer_multimatch_a_home") << a << QStringLiteral("home") << b; | ||
246 | QTest::newRow("prefer_multimatch_b_home") << b << QStringLiteral("home") << b; | 246 | QTest::newRow("prefer_multimatch_b_home") << b << QStringLiteral("home") << b; | ||
247 | QTest::newRow("prefer_multimatch_a_user") << a << QStringLiteral("user") << a; | 247 | QTest::newRow("prefer_multimatch_a_user") << a << QStringLiteral("user") << a; | ||
248 | QTest::newRow("prefer_multimatch_b_user") << b << QStringLiteral("user") << a; | 248 | QTest::newRow("prefer_multimatch_b_user") << b << QStringLiteral("user") << a; | ||
249 | } | 249 | } | ||
250 | { | ||||
251 | const StringList a = { | ||||
252 | QStringLiteral("/home/user/project/A/file"), | ||||
253 | QStringLiteral("/home/user/project/B/project/A/file"), | ||||
254 | QStringLiteral("/home/user/project/user/C/D/E"), | ||||
255 | }; | ||||
256 | const StringList b = { | ||||
257 | QStringLiteral("/home/user/project/B/project/A/file"), | ||||
258 | QStringLiteral("/home/user/project/A/file"), | ||||
259 | }; | ||||
260 | const StringList c = { | ||||
261 | QStringLiteral("/home/user/project/user/C/D/E"), | ||||
262 | QStringLiteral("/home/user/project/A/file"), | ||||
263 | QStringLiteral("/home/user/project/B/project/A/file"), | ||||
264 | }; | ||||
265 | QTest::newRow("prefer_multimatch_a_project/file") << a << QStringLiteral("project/file") << b; | ||||
266 | QTest::newRow("prefer_multimatch_b_project/file") << b << QStringLiteral("project/file") << b; | ||||
267 | QTest::newRow("prefer_multimatch_a_project/le") << a << QStringLiteral("project/le") << b; | ||||
268 | QTest::newRow("prefer_multimatch_b_project/le") << b << QStringLiteral("project/le") << b; | ||||
269 | QTest::newRow("prefer_multimatch_a_project/a/file") << a << QStringLiteral("project/a/file") << b; | ||||
270 | QTest::newRow("prefer_multimatch_b_project/a/file") << b << QStringLiteral("project/a/file") << b; | ||||
271 | QTest::newRow("prefer_multimatch_a_project_user") << a << QStringLiteral("user") << c; | ||||
272 | QTest::newRow("prefer_multimatch_c_project_user") << c << QStringLiteral("user") << c; | ||||
273 | } | ||||
250 | } | 274 | } | ||
251 | 275 | | |||
252 | void TestQuickOpen::testProjectFileFilter() | 276 | void TestQuickOpen::testProjectFileFilter() | ||
253 | { | 277 | { | ||
254 | QTemporaryDir dir; | 278 | QTemporaryDir dir; | ||
255 | TestProject* project = new TestProject(Path(dir.path())); | 279 | TestProject* project = new TestProject(Path(dir.path())); | ||
256 | ProjectFolderItem* foo = createChild<ProjectFolderItem>(project->projectItem(), QStringLiteral("foo")); | 280 | ProjectFolderItem* foo = createChild<ProjectFolderItem>(project->projectItem(), QStringLiteral("foo")); | ||
257 | createChild<ProjectFileItem>(foo, QStringLiteral("bar")); | 281 | createChild<ProjectFileItem>(foo, QStringLiteral("bar")); | ||
▲ Show 20 Lines • Show All 86 Lines • Show Last 20 Lines |