settingsDirAndFile returns a directory in which settings should be stored and the name of the settings file. The caller must delete the directory when done.
(t *testing.T)
| 12 | // and the name of the settings file. The caller must delete the directory when |
| 13 | // done. |
| 14 | func settingsDirAndFile(t *testing.T) (string, string) { |
| 15 | tmpDir, err := os.MkdirTemp("", "pprof_settings_test") |
| 16 | if err != nil { |
| 17 | t.Fatalf("error creating temporary directory: %v", err) |
| 18 | } |
| 19 | return tmpDir, filepath.Join(tmpDir, "settings.json") |
| 20 | } |
| 21 | |
| 22 | func TestSettings(t *testing.T) { |
| 23 | tmpDir, fname := settingsDirAndFile(t) |
no outgoing calls
no test coverage detected
searching dependent graphs…