From 56523fc6a304c09f252449342b10c52f7836c4aa Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Wed, 13 May 2026 10:44:57 -0400 Subject: create print job --- lulu_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lulu_test.go') diff --git a/lulu_test.go b/lulu_test.go index 613cc4b..ceb0990 100644 --- a/lulu_test.go +++ b/lulu_test.go @@ -70,6 +70,22 @@ func requireUnmarshalJsonEq[T any](t *testing.T, expected T, j string) { require.Equal(t, expected, actual) } +// assert that t2 is after t1 +func requireAfter(t *testing.T, t2, t1 time.Time) { + t.Helper() + require.Truef(t, t2.After(t1), "%s not after %s", t2, t1) +} + +// assert that dt2 is not before tt1 +func requireNotBeforeDate(t *testing.T, dt2, dt1 Date) { + t.Helper() + y2, m2, d2 := time.Time(dt2).UTC().Date() + y1, m1, d1 := time.Time(dt1).UTC().Date() + require.Truef(t, y2 >= y1 && m2 >= m1 && d2 >= d1, "%s is before %s", + time.Date(y2, m2, d2, 0, 0, 0, 0, time.UTC).Format(time.DateOnly), + time.Date(y1, m1, d1, 0, 0, 0, 0, time.UTC).Format(time.DateOnly)) +} + // poll periodically calls f() until it returns true or the deadline is exceeded. func poll(t *testing.T, f func() bool) { t.Helper() -- cgit v1.2.3