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

Commit d55d8ce

Browse files
committed
Test no error is raised by time parsing and GetLatestCommitTime
1 parent 16fb543 commit d55d8ce

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

repo_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ import (
1111
)
1212

1313
func TestGetLatestCommitTime(t *testing.T) {
14-
lct, _ := GetLatestCommitTime(".")
14+
lct, err := GetLatestCommitTime(".")
15+
assert.NoError(t, err)
1516
// Time is in the past
1617
assert.True(t, lct.Unix() < time.Now().Unix())
1718
// Time is after Mon Oct 23 03:52:09 2017 +0300
1819
// which is the time of commit
1920
// d47b98c44c9a6472e44ab80efe65235e11c6da2a
20-
refTime, _ := time.Parse("Mon Jan 02 15:04:05 2006 -0700", "Mon Oct 23 03:52:09 2017 +0300")
21+
refTime, err := time.Parse("Mon Jan 02 15:04:05 2006 -0700", "Mon Oct 23 03:52:09 2017 +0300")
22+
assert.NoError(t, err)
2123
assert.True(t, lct.Unix() > refTime.Unix())
2224
}

0 commit comments

Comments
 (0)