MCPcopy Create free account
hub / github.com/dagger/dagger / TestListSubdirectories

Function TestListSubdirectories

core/changeset_git_test.go:124–134  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

122}
123
124func TestListSubdirectories(t *testing.T) {
125 root := t.TempDir()
126 require.NoError(t, os.MkdirAll(filepath.Join(root, "a", "b"), 0755))
127 require.NoError(t, os.MkdirAll(filepath.Join(root, "c"), 0755))
128 require.NoError(t, os.WriteFile(filepath.Join(root, "file.txt"), []byte("."), 0644))
129
130 dirs, err := listSubdirectories(root)
131 require.NoError(t, err)
132 slices.Sort(dirs)
133 require.Equal(t, []string{"a/", "a/b/", "c/"}, dirs)
134}
135
136func TestDiffStringSlices(t *testing.T) {
137 tests := []struct {

Callers

nothing calls this directly

Calls 5

listSubdirectoriesFunction · 0.85
MkdirAllMethod · 0.80
EqualMethod · 0.65
WriteFileMethod · 0.45
SortMethod · 0.45

Tested by

no test coverage detected