From ed409be48c48a4221202fc52fbd35d3642043860 Mon Sep 17 00:00:00 2001 From: Victor Blomqvist Date: Thu, 12 Sep 2013 13:37:44 +0800 Subject: [PATCH] expanded test for WithinDuration to test for both |a-b|>=dt and |b-a|>=dt --- assert/assertions_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/assert/assertions_test.go b/assert/assertions_test.go index 0c3a821..174574c 100644 --- a/assert/assertions_test.go +++ b/assert/assertions_test.go @@ -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") }