summaryrefslogtreecommitdiff
path: root/branch_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'branch_test.go')
-rw-r--r--branch_test.go28
1 files changed, 4 insertions, 24 deletions
diff --git a/branch_test.go b/branch_test.go
index 6c4a037..2b168f5 100644
--- a/branch_test.go
+++ b/branch_test.go
@@ -12,35 +12,15 @@ func TestBranchIterator(t *testing.T) {
i, err := repo.NewBranchIterator(BranchLocal)
checkFatal(t, err)
- b, err := i.NextBranch()
+ b, bt, err := i.Next()
checkFatal(t, err)
- if name, _ := b.Branch.Name(); name != "master" {
+ if name, _ := b.Name(); name != "master" {
t.Fatalf("expected master")
- }
- if b.Type != BranchLocal {
+ } else if bt != BranchLocal {
t.Fatalf("expected BranchLocal, not %v", t)
}
- b, err = i.NextBranch()
+ b, bt, err = i.Next()
if err != ErrIterOver {
t.Fatal("expected iterover")
}
-
- // test channel iterator
-
- i, err = repo.NewBranchIterator(BranchLocal)
- checkFatal(t, err)
-
- list := make([]string, 0)
- for ref := range NameIteratorChannel(i) {
- list = append(list, ref)
- }
-
- if len(list) != 1 {
- t.Fatal("expected single match")
- }
-
- if list[0] != "master" {
- t.Fatal("expected master")
- }
-
}