MCPcopy Index your code
hub / github.com/docker/docker-agent / collectExamples

Function collectExamples

pkg/config/examples_test.go:33–53  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

31}
32
33func collectExamples(t *testing.T) []string {
34 t.Helper()
35
36 var files []string
37 err := filepath.WalkDir(filepath.Join("..", "..", "examples"), func(path string, d fs.DirEntry, err error) error {
38 if err != nil {
39 return err
40 }
41 if !d.IsDir() {
42 ext := filepath.Ext(path)
43 if ext == ".yaml" || ext == ".hcl" {
44 files = append(files, path)
45 }
46 }
47 return nil
48 })
49 require.NoError(t, err)
50 assert.NotEmpty(t, files)
51
52 return files
53}
54
55func TestParseExamples(t *testing.T) {
56 t.Parallel()

Callers 4

TestParseExamplesFunction · 0.70
TestHCLExamplesMatchYAMLFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected