diff --git a/src/os/os_test.go b/src/os/os_test.go index 765797f5fb..d2e8ed5d82 100644 --- a/src/os/os_test.go +++ b/src/os/os_test.go @@ -2687,7 +2687,7 @@ func TestOpenFileKeepsPermissions(t *testing.T) { } func TestDirFS(t *testing.T) { - if err := fstest.TestFS(DirFS("./signal"), "signal.go", "internal/pty/pty.go"); err != nil { + if err := fstest.TestFS(DirFS("./testdata/dirfs"), "a", "b", "dir/x"); err != nil { t.Fatal(err) } } diff --git a/src/os/testdata/dirfs/a b/src/os/testdata/dirfs/a new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/os/testdata/dirfs/b b/src/os/testdata/dirfs/b new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/os/testdata/dirfs/dir/x b/src/os/testdata/dirfs/dir/x new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/testing/fstest/testfs.go b/src/testing/fstest/testfs.go index 4da6f04eed..a7f8007333 100644 --- a/src/testing/fstest/testfs.go +++ b/src/testing/fstest/testfs.go @@ -24,6 +24,7 @@ import ( // It also checks that the file system contains at least the expected files. // As a special case, if no expected files are listed, fsys must be empty. // Otherwise, fsys must only contain at least the listed files: it can also contain others. +// The contents of fsys must not change concurrently with TestFS. // // If TestFS finds any misbehaviors, it returns an error reporting all of them. // The error text spans multiple lines, one per detected misbehavior.