(t *testing.T)
| 297 | } |
| 298 | |
| 299 | func Test_SaveConfig_noOldFile(t *testing.T) { |
| 300 | path := t.TempDir() + "/nextdns.conf" |
| 301 | |
| 302 | str := "100MB" |
| 303 | c := map[string]ConfigEntry{ |
| 304 | "cache-size": ConfigValue{Value: &str, Default: "0"}, |
| 305 | } |
| 306 | |
| 307 | if err := (ConfigFileStorer{File: path}).SaveConfig(c); err != nil { |
| 308 | t.Fatal(err) |
| 309 | } |
| 310 | |
| 311 | got := readFile(t, path) |
| 312 | if !strings.Contains(got, "cache-size 100MB\n") { |
| 313 | t.Errorf("expected key written to new file:\n%s", got) |
| 314 | } |
| 315 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…