Skip to content

Commit

Permalink
chore: fix unit test error on PR Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Jul 8, 2022
1 parent c695cc4 commit 9d2e282
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ func TestParseBranchLine_verbose(t *testing.T) {

info, err = gitw.ParseBranchLine("* (头指针在 v0.2.3 分离) 3c08adf chore: update readme add branch info docs", true)
assert.Error(t, err)
info, err = gitw.ParseBranchLine("* (HEAD detached at pull/29/merge) 62f3455 Merge cfc79b748e176c1c9e266c8bc413c87fe974acef into c9503c2aef993a2cf582d90c137deda53c9bca68", true)
assert.Error(t, err)
}

func TestBranchInfo_parse_simple(t *testing.T) {
Expand Down
8 changes: 5 additions & 3 deletions repo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,14 @@ func TestRepo_BranchInfos(t *testing.T) {
assert.NotEmpty(t, bs)
dump.P(bs.BrLines())

assert.NotEmpty(t, repo.BranchInfo("main"))
assert.NotEmpty(t, repo.SearchBranches("main", gitw.BrSearchAll))

cur := repo.CurBranchInfo()
assert.NotEmpty(t, cur)
assert.Equal(t, "main", cur.Name)
if cur != nil {
assert.NotEmpty(t, cur)
assert.Equal(t, "main", cur.Name)
assert.NotEmpty(t, repo.BranchInfo("main"))
}
}

func TestRepo_Info(t *testing.T) {
Expand Down

0 comments on commit 9d2e282

Please sign in to comment.