MCPcopy Create free account
hub / github.com/astercloud/aster / TestEnsureDir

Function TestEnsureDir

pkg/config/paths_test.go:72–83  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

70}
71
72func TestEnsureDir(t *testing.T) {
73 tempDir := t.TempDir()
74 testDir := filepath.Join(tempDir, "test", "nested", "dir")
75
76 if err := EnsureDir(testDir); err != nil {
77 t.Fatalf("EnsureDir failed: %v", err)
78 }
79
80 if _, err := os.Stat(testDir); os.IsNotExist(err) {
81 t.Error("Directory was not created")
82 }
83}
84
85func TestProjectConfigFile(t *testing.T) {
86 tempDir := t.TempDir()

Callers

nothing calls this directly

Calls 4

EnsureDirFunction · 0.85
StatMethod · 0.65
ErrorMethod · 0.65
JoinMethod · 0.45

Tested by

no test coverage detected