| 96 | } |
| 97 | |
| 98 | func (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 | |
| 117 | func (s *SuiteCommit) TestParent(c *C) { |
| 118 | commit, err := s.Commit.Parent(1) |