summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFredrik Meringdal <fmeringdal@hotmail.com>2021-05-14 18:41:42 +0200
committerFredrik Meringdal <fmeringdal@hotmail.com>2021-05-14 18:41:42 +0200
commitc649b501bd3f4c92eead441344534c6b7bb31000 (patch)
tree4191d15f9cb9f4a7303c79617bce720d0cc7e35e
parent1ed4c0663a514d5f312a03fff8eff8c29c649046 (diff)
downloadrust_rrule-c649b501bd3f4c92eead441344534c6b7bb31000.zip
tests
-rw-r--r--src/rrulestr.rs29
1 files changed, 20 insertions, 9 deletions
diff --git a/src/rrulestr.rs b/src/rrulestr.rs
index ea5d994..cf3e9c9 100644
--- a/src/rrulestr.rs
+++ b/src/rrulestr.rs
@@ -609,14 +609,6 @@ mod test {
}
#[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");
assert!(res.is_ok());
@@ -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);