Created
September 22, 2018 20:11
-
-
Save ayrat555/2ffd1ea31178895db866e36d59bf26a3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let s = "* * 5-7 1,2,5 8 sudo rm -rf /"; | |
assert_eq!( | |
CronItem::from_str(s).unwrap(), | |
CronItem { | |
minute: AllValues, | |
hour: AllValues, | |
day_of_month: Interval((5, 7)), | |
month: MultipleValues(vec![1, 2, 5]), | |
day_of_week: SingleValue(8), | |
command: String::from("sudo rm -rf /"), | |
} | |
); | |
let cron_item = CronItem { | |
minute: MultipleValues(vec![1, 10]), | |
hour: Interval((1, 4)), | |
day_of_month: Interval((1, 11)), | |
month: MultipleValues(vec![1, 2, 5]), | |
day_of_week: AllValues, | |
command: String::from("sudo rm -rf /"), | |
}; | |
assert_eq!("1,10 1-4 1-11 1,2,5 * sudo rm -rf /", cron_item.to_string()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment