From 5eb2c7b271716a4999d178d9563ed217cb1c5b5d Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Mon, 11 Jan 2021 17:18:40 +0100 Subject: [PATCH] Satisfy rslib unit tests --- rslib/src/search/sqlwriter.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rslib/src/search/sqlwriter.rs b/rslib/src/search/sqlwriter.rs index 2b5facf70..3b63c2472 100644 --- a/rslib/src/search/sqlwriter.rs +++ b/rslib/src/search/sqlwriter.rs @@ -226,7 +226,7 @@ impl SqlWriter<'_> { match ease { EaseKind::Rated(u) => write!(self.sql, " and ease = {})", u), - EaseKind::Reviewed => write!(self.sql, " and ease in (1, 2, 3, 4))"), + EaseKind::Reviewed => write!(self.sql, " and ease between 1 and 4)"), EaseKind::Manually => write!(self.sql, " and ease = 0)"), } .unwrap(); @@ -719,14 +719,14 @@ mod test { assert_eq!( s(ctx, "rated:2").0, format!( - "(c.id in (select cid from revlog where id>{}))", + "(c.id in (select cid from revlog where id>{} and ease between 1 and 4))", (timing.next_day_at - (86_400 * 2)) * 1_000 ) ); assert_eq!( s(ctx, "rated:400:1").0, format!( - "(c.id in (select cid from revlog where id>{} and ease=1))", + "(c.id in (select cid from revlog where id>{} and ease = 1))", (timing.next_day_at - (86_400 * 365)) * 1_000 ) );