(t *testing.T)
| 49 | } |
| 50 | |
| 51 | func TestLoadConstantsCorrupt(t *testing.T) { |
| 52 | dir := t.TempDir() |
| 53 | // corrupt file → defaults (a stderr notice is also emitted, but asserting |
| 54 | // on stderr is brittle; the defaults return is the contract that matters) |
| 55 | p := filepath.Join(dir, "corrupt.json") |
| 56 | if err := os.WriteFile(p, []byte("not valid json"), 0o644); err != nil { |
| 57 | t.Fatal(err) |
| 58 | } |
| 59 | if got := LoadConstants(p); got != DefaultConstants() { |
| 60 | t.Errorf("corrupt file should give defaults, got %+v", got) |
| 61 | } |
| 62 | } |
nothing calls this directly
no test coverage detected