MCPcopy Create free account
hub / github.com/go-git/go-git / TestParents

Method TestParents

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

Source from the content-addressed store, hash-verified

52}
53
54func (s *SuiteCommit) TestParents(c *C) {
55 expected := []string{
56 "35e85108805c84807bc66a02d91535e1e24b38b9",
57 "a5b8b09e2f8fcb0bb99d3ccb0958157b40890d69",
58 }
59
60 var output []string
61 i := s.Commit.Parents()
62 err := i.ForEach(func(commit *Commit) error {
63 output = append(output, commit.ID().String())
64 return nil
65 })
66
67 c.Assert(err, IsNil)
68 c.Assert(output, DeepEquals, expected)
69
70 i.Close()
71}
72
73func (s *SuiteCommit) TestParent(c *C) {
74 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