(t *testing.T)
| 80 | } |
| 81 | |
| 82 | func Test_LoadConfig_stripsInlineComment(t *testing.T) { |
| 83 | path := writeConfigFile(t, "debug false # enable for troubleshooting\n") |
| 84 | var val bool |
| 85 | c := map[string]ConfigEntry{ |
| 86 | "debug": ConfigFlag{Value: &val, Default: false}, |
| 87 | } |
| 88 | storer := ConfigFileStorer{File: path} |
| 89 | if err := storer.LoadConfig(c); err != nil { |
| 90 | t.Fatalf("LoadConfig: %v", err) |
| 91 | } |
| 92 | if val { |
| 93 | t.Errorf("expected false, got %v", val) |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | func Test_SaveConfig_preservesFullLineComments(t *testing.T) { |
| 98 | original := "# cache setting\ncache-size 100MB\n" |
nothing calls this directly
no test coverage detected
searching dependent graphs…