expanded test for WithinDuration to test for both |a-b|>=dt and |b-a|>=dt

pull/21/head
Victor Blomqvist 2013-09-12 13:37:44 +08:00
parent 0378c681e8
commit ed409be48c
1 changed files with 2 additions and 0 deletions

View File

@ -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")
}