aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@golang.org>2019-12-06 16:20:50 +0000
committerBrad Fitzpatrick <bradfitz@golang.org>2019-12-06 18:04:42 +0000
commita6c8fac78194bf84eb75c845f2a80646211877c5 (patch)
treebb8b291e07fd5a2073e9bc46e65907c2ec19ccd9 /src
parent69614c0d0e05787c8203bdc364c3293e1cf5094a (diff)
downloadgo-a6c8fac78194bf84eb75c845f2a80646211877c5.tar.xz
os: skip a new failing test on Windows
This test was recently added in CL 209961. Apparently Windows can't seek a directory filehandle? And move the test from test/fixedbugs (which is mostly for compiler bugs) to an os package test. Updates #36019 Change-Id: I626b69b0294471014901d0ccfeefe5e2c7651788 Reviewed-on: https://go-review.googlesource.com/c/go/+/210283 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src')
-rw-r--r--src/os/os_test.go42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/os/os_test.go b/src/os/os_test.go
index 02c80f3d81..278c19e44b 100644
--- a/src/os/os_test.go
+++ b/src/os/os_test.go
@@ -2406,3 +2406,45 @@ func TestUserHomeDir(t *testing.T) {
t.Fatalf("dir %s is not directory; type = %v", dir, fi.Mode())
}
}
+
+func TestDirSeek(t *testing.T) {
+ if runtime.GOOS == "windows" {
+ testenv.SkipFlaky(t, 36019)
+ }
+ wd, err := Getwd()
+ if err != nil {
+ t.Fatal(err)
+ }
+ f, err := Open(wd)
+ if err != nil {
+ t.Fatal(err)
+ }
+ dirnames1, err := f.Readdirnames(0)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ ret, err := f.Seek(0, 0)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if ret != 0 {
+ t.Fatalf("seek result not zero: %d", ret)
+ }
+
+ dirnames2, err := f.Readdirnames(0)
+ if err != nil {
+ t.Fatal(err)
+ return
+ }
+
+ if len(dirnames1) != len(dirnames2) {
+ t.Fatalf("listings have different lengths: %d and %d\n", len(dirnames1), len(dirnames2))
+ }
+ for i, n1 := range dirnames1 {
+ n2 := dirnames2[i]
+ if n1 != n2 {
+ t.Fatalf("different name i=%d n1=%s n2=%s\n", i, n1, n2)
+ }
+ }
+}