diff options
| author | Jesse Ezell <[email protected]> | 2014-03-20 01:27:03 -0700 |
|---|---|---|
| committer | Jesse Ezell <[email protected]> | 2014-03-20 20:28:41 -0700 |
| commit | 5590078e6ff04be425b4a833adb44a0845c0b52f (patch) | |
| tree | 22daef05a7569634f35942033f152580a2379286 /branch_test.go | |
| parent | 37b950bc90aeefac38ef611273f9590eb2cabb68 (diff) | |
remove channel based iteration for branch / ref. Add ReferenceNameIterator. All iterators use Next(). Remove interfaces.
Diffstat (limited to 'branch_test.go')
| -rw-r--r-- | branch_test.go | 28 |
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") - } - } |
