Skip to content

Commit

Permalink
NumericFilter test: adjust for new BPM filter (half/double, opt. int …
Browse files Browse the repository at this point in the history
…range)
  • Loading branch information
ronso0 committed Oct 8, 2023
1 parent d0a807c commit 8ecff43
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/test/searchqueryparsertest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,10 @@ TEST_F(SearchQueryParserTest, NumericFilter) {
pTrack->trySetBpm(127.12);
EXPECT_TRUE(pQuery->match(pTrack));

EXPECT_STREQ(
qPrintable(QString("bpm = 127.12")),
qPrintable(pQuery->toSql()));
EXPECT_STREQ( // half/double BPM, half
qPrintable(QString("(bpm = 127.12) OR (bpm BETWEEN 63 AND 64) OR "
"(bpm BETWEEN 254 AND 255)")),
qPrintable(pQuery->toSql()));
}

TEST_F(SearchQueryParserTest, NumericFilterYear) {
Expand Down Expand Up @@ -399,9 +400,9 @@ TEST_F(SearchQueryParserTest, NumericFilterAllowsSpace) {
pTrack->trySetBpm(127.12);
EXPECT_TRUE(pQuery->match(pTrack));

EXPECT_STREQ(
qPrintable(QString("bpm = 127.12")),
qPrintable(pQuery->toSql()));
EXPECT_STREQ(qPrintable(QString("(bpm = 127.12) OR (bpm BETWEEN 63 AND 64) "
"OR (bpm BETWEEN 254 AND 255)")),
qPrintable(pQuery->toSql()));
}

TEST_F(SearchQueryParserTest, NumericFilterOperators) {
Expand Down

0 comments on commit 8ecff43

Please sign in to comment.