mirror of
https://github.com/PerMalmberg/libcron.git
synced 2025-10-18 05:45:20 -05:00
Implemented support for using textual names in randomization.
This commit is contained in:
@@ -224,4 +224,17 @@ SCENARIO("Dates that does not exist")
|
||||
SCENARIO("Date that exist in one of the months")
|
||||
{
|
||||
REQUIRE(CronData::create("0 0 * 31 APR,MAY ?").is_valid());
|
||||
}
|
||||
|
||||
SCENARIO("Replacing text with numbers")
|
||||
{
|
||||
{
|
||||
std::string s = "SUN-TUE";
|
||||
REQUIRE(CronData::replace_string_name_with_numeric<libcron::DayOfWeek>(s) == "0-2");
|
||||
}
|
||||
|
||||
{
|
||||
std::string s = "JAN-DEC";
|
||||
REQUIRE(CronData::replace_string_name_with_numeric<libcron::Months>(s) == "1-12");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user