MCPcopy Index your code
hub / github.com/go-git/go-git / TestParents

Method TestParents

plumbing/object/commit_test.go:98–115  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

96}
97
98func (s *SuiteCommit) TestParents(c *C) {
99 expected := []string{
100 "35e85108805c84807bc66a02d91535e1e24b38b9",
101 "a5b8b09e2f8fcb0bb99d3ccb0958157b40890d69",
102 }
103
104 var output []string
105 i := s.Commit.Parents()
106 err := i.ForEach(func(commit *Commit) error {
107 output = append(output, commit.ID().String())
108 return nil
109 })
110
111 c.Assert(err, IsNil)
112 c.Assert(output, DeepEquals, expected)
113
114 i.Close()
115}
116
117func (s *SuiteCommit) TestParent(c *C) {
118 commit, err := s.Commit.Parent(1)

Callers

nothing calls this directly

Calls 5

ParentsMethod · 0.80
ForEachMethod · 0.65
StringMethod · 0.65
IDMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected