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

Function TestLoad_PartialConfig

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

Source from the content-addressed store, hash-verified

97}
98
99func TestLoad_PartialConfig(t *testing.T) {
100 dir := t.TempDir()
101 codemapDir := filepath.Join(dir, ".codemap")
102 if err := os.MkdirAll(codemapDir, 0755); err != nil {
103 t.Fatal(err)
104 }
105
106 data := `{"only": ["go", "ts"]}`
107 if err := os.WriteFile(filepath.Join(codemapDir, "config.json"), []byte(data), 0644); err != nil {
108 t.Fatal(err)
109 }
110
111 cfg := Load(dir)
112 if len(cfg.Only) != 2 || cfg.Only[0] != "go" || cfg.Only[1] != "ts" {
113 t.Errorf("unexpected Only: %v", cfg.Only)
114 }
115 if len(cfg.Exclude) != 0 {
116 t.Errorf("expected empty Exclude, got %v", cfg.Exclude)
117 }
118 if cfg.Depth != 0 {
119 t.Errorf("expected zero Depth, got %d", cfg.Depth)
120 }
121}
122
123func TestLoad_MalformedJSON(t *testing.T) {
124 dir := t.TempDir()

Callers

nothing calls this directly

Calls 1

LoadFunction · 0.85

Tested by

no test coverage detected