MCPcopy Create free account
hub / github.com/JordanCoin/codemap / TestLoad_EmptyObject

Function TestLoad_EmptyObject

config/config_test.go:141–157  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

139}
140
141func TestLoad_EmptyObject(t *testing.T) {
142 dir := t.TempDir()
143 codemapDir := filepath.Join(dir, ".codemap")
144 if err := os.MkdirAll(codemapDir, 0755); err != nil {
145 t.Fatal(err)
146 }
147
148 data := `{}`
149 if err := os.WriteFile(filepath.Join(codemapDir, "config.json"), []byte(data), 0644); err != nil {
150 t.Fatal(err)
151 }
152
153 cfg := Load(dir)
154 if len(cfg.Only) != 0 || len(cfg.Exclude) != 0 || cfg.Depth != 0 {
155 t.Errorf("expected zero-value config for empty object, got %+v", cfg)
156 }
157}
158
159func TestConfigPath(t *testing.T) {
160 got := ConfigPath("/my/project")

Callers

nothing calls this directly

Calls 1

LoadFunction · 0.85

Tested by

no test coverage detected