aboutsummaryrefslogtreecommitdiffstats
path: root/common_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'common_test.go')
-rw-r--r--common_test.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/common_test.go b/common_test.go
index 21b4481..a7cd755 100644
--- a/common_test.go
+++ b/common_test.go
@@ -169,3 +169,14 @@ func (s *SuiteCommon) TestCountLines(c *C) {
c.Assert(o, Equals, t.e, Commentf("subtest %d, input=%q", i, t.i))
}
}
+
+func AssertReferences(c *C, r *Repository, expected map[string]string) {
+ for name, target := range expected {
+ expected := plumbing.NewReferenceFromStrings(name, target)
+
+ obtained, err := r.Reference(expected.Name(), true)
+ c.Assert(err, IsNil)
+
+ c.Assert(obtained, DeepEquals, expected)
+ }
+}