From 0073103e650bd8a4b6ebcf64ff1683709e2e4239 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Wed, 31 Oct 2018 23:57:53 +0700 Subject: lib/git: add function to fetch and list tags --- lib/git/git_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'lib/git/git_test.go') diff --git a/lib/git/git_test.go b/lib/git/git_test.go index e52d18b5..390c24f8 100644 --- a/lib/git/git_test.go +++ b/lib/git/git_test.go @@ -236,6 +236,30 @@ func TestLatestVersion(t *testing.T) { } } +func TestListTag(t *testing.T) { + cases := []struct { + desc string + exp []string + expErr string + }{{ + desc: "With default repo", + exp: []string{"v0.1.0", "v0.2.0"}, + }} + + for _, c := range cases { + t.Log(c.desc) + mock.Reset(true) + + got, err := ListTags(_testRepoDir) + if err != nil { + test.Assert(t, "err", c.expErr, err.Error(), true) + continue + } + + test.Assert(t, "tags", c.exp, got, true) + } +} + func TestLogRevisions(t *testing.T) { cases := []struct { desc string -- cgit v1.3