From c649b501bd3f4c92eead441344534c6b7bb31000 Mon Sep 17 00:00:00 2001 From: Fredrik Meringdal Date: Fri, 14 May 2021 18:41:42 +0200 Subject: tests --- src/rrulestr.rs | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'src/rrulestr.rs') diff --git a/src/rrulestr.rs b/src/rrulestr.rs index ea5d994..cf3e9c9 100644 --- a/src/rrulestr.rs +++ b/src/rrulestr.rs @@ -608,14 +608,6 @@ mod test { assert!(res.is_ok()); } - #[test] - fn it_rejects_garbage_strings() { - let garbage_strings = vec!["", "!", "1", "fioashfoias!?", " "]; - for string in garbage_strings { - assert!(build_rrule(string).is_err()) - } - } - #[test] fn rrule() { let res = build_rruleset("DTSTART:20120201T120000Z\nRRULE:FREQ=DAILY;COUNT=5"); @@ -643,7 +635,26 @@ mod test { // Invalid stuff //////////////////////////////////////////////////// #[test] - fn garbage_strings() { + fn garbage_strings_rrule() { + let test_cases = vec![ + "", + "!", + "1", + "fioashfoias!?", + " ", + "helloworld", + "foo bar", + "hello\nworld", + "RRUle:test", + ]; + for test_case in &test_cases { + let res = build_rrule(test_case); + assert!(res.is_err()); + } + } + + #[test] + fn garbage_strings_rrule_set() { let test_cases = vec!["helloworld", "foo bar", "hello\nworld", "RRUle:test"]; for test_case in &test_cases { let res = build_rruleset(test_case); -- cgit v1.2.3