mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Improve accuracy of test to assess return of time.Now()
This commit is contained in:
committed by
Dan Christian Bogos
parent
d2fbb0f3d4
commit
1599ed2a5e
@@ -828,9 +828,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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user