mirror of
https://github.com/clementine-player/Clementine
synced 2024-12-15 10:48:33 +01:00
parent
645b819b68
commit
2e71390acd
@ -111,11 +111,11 @@ bool LibraryBackend::Like(const char* needle, const char* haystack) {
|
||||
}
|
||||
QString b = QString::fromUtf8(haystack);
|
||||
foreach (const QString& query, query_cache_) {
|
||||
if (b.contains(query, Qt::CaseInsensitive)) {
|
||||
return true;
|
||||
if (!b.contains(query, Qt::CaseInsensitive)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Custom LIKE(X, Y) function for sqlite3 that supports case insensitive unicode matching.
|
||||
|
@ -224,8 +224,8 @@ TEST_F(LibraryBackendTest, LikeCacheInvalidated) {
|
||||
|
||||
TEST_F(LibraryBackendTest, LikeQuerySplit) {
|
||||
EXPECT_TRUE(backend_->Like("%foo bar%", "foobar"));
|
||||
EXPECT_TRUE(backend_->Like("%foo bar%", "barbaz"));
|
||||
EXPECT_TRUE(backend_->Like("%foo bar%", "foobaz"));
|
||||
EXPECT_FALSE(backend_->Like("%foo bar%", "barbaz"));
|
||||
EXPECT_FALSE(backend_->Like("%foo bar%", "foobaz"));
|
||||
EXPECT_FALSE(backend_->Like("%foo bar%", "baz"));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user