Skip to content

Commit

Permalink
Update CronScheduleTest.cpp (#38)
Browse files Browse the repository at this point in the history
* Update CronScheduleTest.cpp

* Update CronScheduleTest.cpp

Edited code that was causing test to fail.

---------

Co-authored-by: Per Malmberg <PerMalmberg@users.noreply.github.com>
  • Loading branch information
nkinar and PerMalmberg authored Aug 2, 2024
1 parent 7c7d290 commit aa3d436
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/CronScheduleTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,15 @@ SCENARIO("Examples from README.md")
DT(2018_y / 03 / 1, hours{12}, minutes{13}, seconds{48})
}));

REQUIRE(test("0 * * * * ?", DT(2018_y / 03 / 1, hours{ 12 }, minutes{ 0 }, seconds{ 10 }),
{
DT(2018_y / 03 / 1, hours{12}, minutes{1}, seconds{0}),
DT(2018_y / 03 / 1, hours{12}, minutes{2}, seconds{0}),
DT(2018_y / 03 / 1, hours{12}, minutes{3}, seconds{0}),
DT(2018_y / 03 / 1, hours{12}, minutes{4}, seconds{0})
}));


REQUIRE(test("0 0 12 * * MON-FRI", DT(2018_y / 03 / 10, hours{12}, minutes{13}, seconds{45}),
{
DT(2018_y / 03 / 12, hours{12}),
Expand Down Expand Up @@ -212,4 +221,4 @@ SCENARIO("Examples from README.md")
SCENARIO("Unable to calculate time point")
{
REQUIRE_FALSE(test( "0 0 * 31 FEB *", DT(2021_y / 1 / 1), DT(2022_y / 1 / 1)));
}
}

0 comments on commit aa3d436

Please sign in to comment.