MCPcopy Create free account
hub / github.com/codehamr/codehamr / TestSetActiveRejectsUnknown

Function TestSetActiveRejectsUnknown

internal/config/config_test.go:434–439  ·  view source on GitHub ↗

TestSetActiveRejectsUnknown: SetActive returns an error for an unknown name.

(t *testing.T)

Source from the content-addressed store, hash-verified

432
433// TestSetActiveRejectsUnknown: SetActive returns an error for an unknown name.
434func TestSetActiveRejectsUnknown(t *testing.T) {
435 cfg := &Config{Active: "a", Models: map[string]*Profile{"a": {}}}
436 if err := cfg.SetActive("nope"); err == nil {
437 t.Fatal("expected error for unknown model")
438 }
439}
440
441// TestSetActiveRevertsOnSaveFailure guards in-memory/on-disk drift on Save
442// failure. If SetActive mutates Active before a failed Save, ActiveProfile()

Callers

nothing calls this directly

Calls 1

SetActiveMethod · 0.95

Tested by

no test coverage detected