1
0
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:
Per Malmberg
2019-05-17 13:39:32 +02:00
parent a918f3d93f
commit d61086f69e
9 changed files with 180 additions and 23 deletions

View File

@@ -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");
}
}