MCPcopy
hub / github.com/go-git/go-git / TestExamples

Function TestExamples

_examples/common_test.go:57–83  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

55)
56
57func TestExamples(t *testing.T) {
58 flag.Parse()
59 if !*examplesTest && os.Getenv("CI") == "" {
60 t.Skip("skipping examples tests, pass --examples to execute it")
61 return
62 }
63
64 defer deleteTempFolders()
65
66 exampleMains, err := filepath.Glob(filepath.Join(basepath, "*", "main.go"))
67 if err != nil {
68 t.Errorf("error finding tests: %s", err)
69 }
70
71 for _, main := range exampleMains {
72 dir := filepath.Dir(main)
73 _, name := filepath.Split(dir)
74
75 if ignored[name] {
76 continue
77 }
78
79 t.Run(name, func(t *testing.T) {
80 testExample(t, name, dir)
81 })
82 }
83}
84
85func tempFolder() string {
86 path, err := os.MkdirTemp("", "")

Callers

nothing calls this directly

Calls 6

deleteTempFoldersFunction · 0.85
testExampleFunction · 0.85
GlobMethod · 0.80
JoinMethod · 0.80
SkipMethod · 0.65
ParseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…