aboutsummaryrefslogtreecommitdiff
path: root/src/os/os_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/os/os_test.go')
-rw-r--r--src/os/os_test.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/os/os_test.go b/src/os/os_test.go
index e8c64510f5..520916d880 100644
--- a/src/os/os_test.go
+++ b/src/os/os_test.go
@@ -688,6 +688,10 @@ func TestReaddirOfFile(t *testing.T) {
if err == nil {
t.Error("Readdirnames succeeded; want non-nil error")
}
+ var pe *PathError
+ if !errors.As(err, &pe) || pe.Path != f.Name() {
+ t.Errorf("Readdirnames returned %q; want a PathError with path %q", err, f.Name())
+ }
if len(names) > 0 {
t.Errorf("unexpected dir names in regular file: %q", names)
}