Update EndOfMonth coreutils test

This commit is contained in:
ionutboangiu
2023-10-18 11:50:47 -04:00
committed by Dan Christian Bogos
parent ccd4a92432
commit 6bcc374d45

View File

@@ -823,9 +823,11 @@ func TestEndOfMonth(t *testing.T) {
if !eom.Equal(expected) {
t.Errorf("Expected %v was %v", expected, eom)
}
// Date ref represents zero time instant, will return time.Now().
eom = GetEndOfMonth(time.Date(1, time.January, 1, 0, 0, 0, 0, time.UTC))
if time.Now().Add(-1).Before(eom) {
t.Errorf("Expected %v was %v", expected, eom)
if currentDateRef := time.Now(); currentDateRef.Before(eom) ||
time.Since(eom) > time.Millisecond {
t.Errorf("Expected GetEndOfMonth to return the current date info, received: %s", eom)
}
}