os: testTempDir: now that we have os.ReadDir, bring back one use of it in a test

Этот коммит содержится в:
Dan Kegel 2022-02-13 09:56:21 -08:00 коммит произвёл Nia
родитель a9a225ba26
коммит 31a3a7c84b

Просмотреть файл

@ -119,6 +119,13 @@ func testTempDir(t *testing.T) {
if !fi.IsDir() { if !fi.IsDir() {
t.Errorf("dir %q is not a dir", dir) t.Errorf("dir %q is not a dir", dir)
} }
files, err := os.ReadDir(dir)
if err != nil {
t.Fatal(err)
}
if len(files) > 0 {
t.Errorf("unexpected %d files in TempDir: %v", len(files), files)
}
glob := filepath.Join(dir, "*.txt") glob := filepath.Join(dir, "*.txt")
if _, err := filepath.Glob(glob); err != nil { if _, err := filepath.Glob(glob); err != nil {