mirror of https://github.com/stretchr/testify.git
expanded test for WithinDuration to test for both |a-b|>=dt and |b-a|>=dt
parent
0378c681e8
commit
ed409be48c
|
@ -370,6 +370,8 @@ func TestWithinDuration(t *testing.T) {
|
|||
b := a.Add(10 * time.Second)
|
||||
|
||||
True(t, WithinDuration(mockT, a, b, 10*time.Second), "A 10s difference is within a 10s time difference")
|
||||
True(t, WithinDuration(mockT, b, a, 10*time.Second), "A 10s difference is within a 10s time difference")
|
||||
|
||||
False(t, WithinDuration(mockT, a, b, 9*time.Second), "A 10s difference is not within a 9s time difference")
|
||||
False(t, WithinDuration(mockT, b, a, 9*time.Second), "A 10s difference is not within a 9s time difference")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue