Skip to content

Commit

Permalink
scheduler: test handle_today with a future date
Browse files Browse the repository at this point in the history
github actions just happen to be in pacific time / utc-7 today
  • Loading branch information
mcspr committed May 22, 2024
1 parent 331c44a commit c8c9150
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions code/test/unit/src/scheduler/scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -420,14 +420,20 @@ void test_keyword_parsing() {
void test_restore_today() {
MAKE_RESTORE_CONTEXT(ctx, schedule);

schedule.time.flags = 0;
const auto original_date = schedule.date;

schedule.date = DateMatch{};
schedule.date.day[15] = true;
schedule.date.month[0] = true;
schedule.date.year = 2006;

TEST_ASSERT_FALSE(handle_today(ctx, 0, schedule));
TEST_ASSERT_EQUAL(1, ctx.pending.size());
TEST_ASSERT_EQUAL(0, ctx.results.size());

schedule.date = original_date;

ctx.pending.clear();
schedule.time.flags = scheduler::FlagUtc;

TEST_ASSERT_TRUE(handle_today(ctx, 0, schedule));
TEST_ASSERT_EQUAL(0, ctx.pending.size());
Expand Down

0 comments on commit c8c9150

Please sign in to comment.