You've already forked agentic-coding-workflow
test(git): add parseRemoteBranches unit test
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package git
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestParseRemoteBranches(t *testing.T) {
|
||||
t.Parallel()
|
||||
input := []byte("aabbccdd\trefs/heads/main\n" +
|
||||
"eeff0011\trefs/heads/develop\n" +
|
||||
"22334455\trefs/heads/feature/foo\n" +
|
||||
"deadbeef\trefs/tags/v1.0\n")
|
||||
got := parseRemoteBranches(input)
|
||||
require.Equal(t, []string{"main", "develop", "feature/foo"}, got)
|
||||
}
|
||||
|
||||
func TestParseRemoteBranches_Empty(t *testing.T) {
|
||||
t.Parallel()
|
||||
got := parseRemoteBranches(nil)
|
||||
require.Nil(t, got)
|
||||
}
|
||||
Reference in New Issue
Block a user