INNER CODE UNIT · Go
TestBranchList
chriswalz/bit · cmd/cmd_test.go:46
func TestBranchList(t *testing.T) {
expects := []string{"master", "fix-sync-upstream"}
notexpects := []string{"origin/master", "origin/HEAD", "origin/fix-sync-upstream"}
reality := branchToString(BranchList())
for _, e := range expects {
assert.Contains(t, reality, e)
}
for _, ne := range notexpects {
assert.NotContains(t, reality, ne)
}
}
func TestToStructuredBranchList(t *testing.T) {
expects :=
[]struct {
raw string
expectedFirstBranchName string
expectedAuthor string