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

Commit f8b81a9

Browse files
committed
Improve test for test for GetLatestCommitTime
Also check that the latest commit is more recent than the commit this PR is based at
1 parent 01daf71 commit f8b81a9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

repo_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,11 @@ import (
1212

1313
func TestGetLatestCommitTime(t *testing.T) {
1414
lct, _ := GetLatestCommitTime(".")
15+
// Time is in the past
1516
assert.True(t, lct.Unix() < time.Now().Unix())
17+
// Time is after Mon Oct 23 03:52:09 2017 +0300
18+
// which is the time of commit
19+
// d47b98c44c9a6472e44ab80efe65235e11c6da2a
20+
refTime, _ := time.Parse("Mon Jan 02 15:04:05 2006 -0700", "Mon Oct 23 03:52:09 2017 +0300")
21+
assert.True(t, lct.Unix() > refTime.Unix())
1622
}

0 commit comments

Comments
 (0)