]> git.giacomolli.uk - onechat/blobdiff - schedule_test.go
Separate multiline Go statements
[onechat] / schedule_test.go
index 5743a22bb3fdae5fd18289a348a58b0ead9fb4cd..03d33c7eb36d91b1d1572ac0436878eca9ef982e 100644 (file)
@@ -287,6 +287,7 @@ func TestSchedulesRunMissedSchedulesOnceAtTheStart(t *testing.T) {
                "[Schedule 1] Sunday 2026-11-08 09:00 -03:00, once\nRemind the user to call.\n" + scheduleLateLine + "\n" + scheduleEmptyReply,
                "[Schedule 2] Sunday 2026-11-08 10:00 -03:00, repeats 0 * * * *\nTell the user the time.\n" + scheduleLateLine + "\n" + scheduleEmptyReply,
        }, texts[len(texts)-2:])
                "[Schedule 1] Sunday 2026-11-08 09:00 -03:00, once\nRemind the user to call.\n" + scheduleLateLine + "\n" + scheduleEmptyReply,
                "[Schedule 2] Sunday 2026-11-08 10:00 -03:00, repeats 0 * * * *\nTell the user the time.\n" + scheduleLateLine + "\n" + scheduleEmptyReply,
        }, texts[len(texts)-2:])
+
        require.Equal(t, "2 | Sunday 2026-11-08 21:00 -03:00 | 0 * * * * | Tell the user the time.", schedules.List())
        require.Equal(t, "<6>schedule ran id=1 late=11h30m0s\n<6>schedule ran id=2 late=10h30m0s\n", logs.String())
 }
        require.Equal(t, "2 | Sunday 2026-11-08 21:00 -03:00 | 0 * * * * | Tell the user the time.", schedules.List())
        require.Equal(t, "<6>schedule ran id=1 late=11h30m0s\n<6>schedule ran id=2 late=10h30m0s\n", logs.String())
 }
@@ -336,7 +337,7 @@ func TestSchedulesCheckTheClockAfterItsWaitLimit(t *testing.T) {
                synctest.Wait()
                require.Zero(t, loop.memory.Len())
                clock.Set(clock.Now().Add(5 * time.Minute))
                synctest.Wait()
                require.Zero(t, loop.memory.Len())
                clock.Set(clock.Now().Add(5 * time.Minute))
-               time.Sleep(scheduleCheck)
+               time.Sleep(scheduleClockWaitTimeout)
                synctest.Wait()
                require.Equal(t, 1, loop.memory.Len())
                require.Contains(t, events.Last("work"), "Check the clock.")
                synctest.Wait()
                require.Equal(t, 1, loop.memory.Len())
                require.Contains(t, events.Last("work"), "Check the clock.")