MCPcopy Create free account
hub / github.com/libgit2/git2go / TestSubmoduleForeach

Function TestSubmoduleForeach

submodule_test.go:7–27  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

5)
6
7func TestSubmoduleForeach(t *testing.T) {
8 t.Parallel()
9 repo := createTestRepo(t)
10 defer cleanupTestRepo(t, repo)
11
12 seedTestRepo(t, repo)
13
14 _, err := repo.Submodules.Add("http://example.org/submodule", "submodule", true)
15 checkFatal(t, err)
16
17 i := 0
18 err = repo.Submodules.Foreach(func(sub *Submodule, name string) error {
19 i++
20 return nil
21 })
22 checkFatal(t, err)
23
24 if i != 1 {
25 t.Fatalf("expected one submodule found but got %d", i)
26 }
27}

Callers

nothing calls this directly

Calls 6

createTestRepoFunction · 0.85
cleanupTestRepoFunction · 0.85
seedTestRepoFunction · 0.85
checkFatalFunction · 0.85
AddMethod · 0.45
ForeachMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…