MCPcopy
hub / github.com/mislav/hub / TestParseRemoteNames

Function TestParseRemoteNames

commands/fetch_test.go:8–27  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

6)
7
8func TestParseRemoteNames(t *testing.T) {
9 args := NewArgs([]string{"fetch", "jingweno,foo"})
10 names := parseRemoteNames(args)
11
12 assert.Equal(t, 2, len(names))
13 assert.Equal(t, "jingweno", names[0])
14 assert.Equal(t, "foo", names[1])
15 cmd := args.ToCmd()
16 assert.Equal(t, "git fetch --multiple jingweno foo", cmd.String())
17
18 args = NewArgs([]string{"fetch", "--multiple", "jingweno", "foo"})
19 names = parseRemoteNames(args)
20 assert.Equal(t, 2, len(names))
21 assert.Equal(t, "jingweno", names[0])
22 assert.Equal(t, "foo", names[1])
23
24 args = NewArgs([]string{"fetch", "--multiple"})
25 names = parseRemoteNames(args)
26 assert.Equal(t, 0, len(names))
27}

Callers

nothing calls this directly

Calls 4

ToCmdMethod · 0.95
NewArgsFunction · 0.85
parseRemoteNamesFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…