Skip to content
This repository was archived by the owner on Apr 12, 2019. It is now read-only.

Commit 1ddbf2e

Browse files
committed
Print actual time when tests fail
1 parent d55d8ce commit 1ddbf2e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

repo_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ func TestGetLatestCommitTime(t *testing.T) {
1414
lct, err := GetLatestCommitTime(".")
1515
assert.NoError(t, err)
1616
// Time is in the past
17-
assert.True(t, lct.Unix() < time.Now().Unix())
17+
now := time.Now()
18+
assert.True(t, lct.Unix() < now.Unix(), "%d not smaller than %d", lct, now)
1819
// Time is after Mon Oct 23 03:52:09 2017 +0300
1920
// which is the time of commit
2021
// d47b98c44c9a6472e44ab80efe65235e11c6da2a
2122
refTime, err := time.Parse("Mon Jan 02 15:04:05 2006 -0700", "Mon Oct 23 03:52:09 2017 +0300")
2223
assert.NoError(t, err)
23-
assert.True(t, lct.Unix() > refTime.Unix())
24+
assert.True(t, lct.Unix() > refTime.Unix(), "%d not greater than %d", lct, refTime)
2425
}

0 commit comments

Comments
 (0)