summaryrefslogtreecommitdiff
path: root/branch_test.go
diff options
context:
space:
mode:
authorJesse Ezell <[email protected]>2014-03-19 20:24:19 -0700
committerJesse Ezell <[email protected]>2014-03-19 20:24:19 -0700
commit37b950bc90aeefac38ef611273f9590eb2cabb68 (patch)
tree592ba37bad5f14e14972d34314f2e2c0bd3bfb03 /branch_test.go
parent27bea93efeba771b72d7c4850067a5dc1339caa6 (diff)
various improvements to interface
Diffstat (limited to 'branch_test.go')
-rw-r--r--branch_test.go17
1 files changed, 8 insertions, 9 deletions
diff --git a/branch_test.go b/branch_test.go
index ee65b07..6c4a037 100644
--- a/branch_test.go
+++ b/branch_test.go
@@ -12,16 +12,15 @@ func TestBranchIterator(t *testing.T) {
i, err := repo.NewBranchIterator(BranchLocal)
checkFatal(t, err)
- ref, err := i.Next()
+ b, err := i.NextBranch()
checkFatal(t, err)
- if ref.Name() != "refs/heads/master" {
- t.Fatalf("expected refs/heads/master, not %v", ref.Name())
+ if name, _ := b.Branch.Name(); name != "master" {
+ t.Fatalf("expected master")
}
- ref, err = i.Next()
- if ref != nil {
- t.Fatal("expected nil")
+ if b.Type != BranchLocal {
+ t.Fatalf("expected BranchLocal, not %v", t)
}
-
+ b, err = i.NextBranch()
if err != ErrIterOver {
t.Fatal("expected iterover")
}
@@ -40,8 +39,8 @@ func TestBranchIterator(t *testing.T) {
t.Fatal("expected single match")
}
- if list[0] != "refs/heads/master" {
- t.Fatal("expected refs/heads/master")
+ if list[0] != "master" {
+ t.Fatal("expected master")
}
}