(t *testing.T)
| 44 | } |
| 45 | |
| 46 | func TestCreateDirAll(t *testing.T) { |
| 47 | tmpdir := t.TempDir() |
| 48 | |
| 49 | tmpdir2 := filepath.Join(tmpdir, "testdir") |
| 50 | require.NoError(t, CreateDirAll(zaptest.NewLogger(t), tmpdir2)) |
| 51 | |
| 52 | require.NoError(t, os.WriteFile(filepath.Join(tmpdir2, "text.txt"), []byte("test text"), PrivateFileMode)) |
| 53 | |
| 54 | if err := CreateDirAll(zaptest.NewLogger(t), tmpdir2); err == nil || !strings.Contains(err.Error(), "to be empty, got") { |
| 55 | t.Fatalf("unexpected error %v", err) |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | func TestExist(t *testing.T) { |
| 60 | fdir := filepath.Join(os.TempDir(), fmt.Sprint(time.Now().UnixNano()+rand.Int63n(1000))) |
nothing calls this directly
no test coverage detected
searching dependent graphs…