From 84c997fa4de33b3d6a94267d3503e8ddca44012d Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Mon, 18 Jan 2021 00:05:05 +0100 Subject: [PATCH] Adjust unit tests for new InvalidRatedEase --- rslib/src/search/parser.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/rslib/src/search/parser.rs b/rslib/src/search/parser.rs index 99e25bcd1..6fdff4d8b 100644 --- a/rslib/src/search/parser.rs +++ b/rslib/src/search/parser.rs @@ -423,7 +423,12 @@ fn parse_prop(s: &str) -> ParseResult { } else { return Err(parse_failure( s, - FailKind::InvalidRatedEase(format!("prop:{}{}{}", prop, operator, days.to_string())), + FailKind::InvalidRatedEase(format!( + "prop:{}{}{}", + prop, + operator, + days.to_string() + )), )); } } else { @@ -918,10 +923,10 @@ mod test { assert_err_kind("rated:", InvalidRatedDays); assert_err_kind("rated:foo", InvalidRatedDays); - assert_err_kind("rated:1:", InvalidRatedEase("1".to_string())); - assert_err_kind("rated:2:-1", InvalidRatedEase("2".to_string())); - assert_err_kind("rated:3:1.1", InvalidRatedEase("3".to_string())); - assert_err_kind("rated:0:foo", InvalidRatedEase("1".to_string())); + assert_err_kind("rated:1:", InvalidRatedEase("rated:1".to_string())); + assert_err_kind("rated:2:-1", InvalidRatedEase("rated:2".to_string())); + assert_err_kind("rated:3:1.1", InvalidRatedEase("rated:3".to_string())); + assert_err_kind("rated:0:foo", InvalidRatedEase("rated:1".to_string())); assert_err_kind("resched:", FailKind::InvalidResched); assert_err_kind("resched:-1", FailKind::InvalidResched);