aboutsummaryrefslogtreecommitdiff
path: root/src/os/read_test.go
AgeCommit message (Collapse)Author
2025-08-27os: return nil slice when ReadDir is used with a file on file_windowsqmuntal
ReadDir should return (nil, ENOTDIR) when the path points to a file instead of a directory. That's the behavior on Unix systems, and it also used to be the behavior on Windows. However, Windows currently returns ([]DirEntry{}, ENOTDIR). We should change the implementation to match the expected behavior. Fixed #75157 Change-Id: I3a3ddb71b5cd6e51dbca435a1585f01116844d4a Reviewed-on: https://go-review.googlesource.com/c/go/+/699375 Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Steven Hartland <stevenmhartland@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-08-20os: use t.TempDir in TestReadOnlyWriteFileKir Kolyshkin
This test is checking WriteFile, not MkdirTemp, and using t.TempDir makes the test case code a tad smaller and simpler. Change-Id: I48837f77572f375d56f3a387efa9a4ee1d3706fd Reviewed-on: https://go-review.googlesource.com/c/go/+/606898 Reviewed-by: Cherry Mui <cherryyz@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-10os: change ioutil-test to os-test in testguoguangwu
Change-Id: I8c5c0831b94261c5880ca22b7ea52cce034d88f1 GitHub-Last-Rev: 5fd119d4e8e5f98690afb2d966c07aea19415db0 GitHub-Pull-Request: golang/go#67248 Reviewed-on: https://go-review.googlesource.com/c/go/+/583876 Auto-Submit: Ian Lance Taylor <iant@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
2023-04-07os: add wasip1 supportJohan Brandhorst-Satzkorn
For #58141 Co-authored-by: Richard Musiol <neelance@gmail.com> Co-authored-by: Achille Roussel <achille.roussel@gmail.com> Co-authored-by: Julien Fabre <ju.pryz@gmail.com> Co-authored-by: Evan Phoenix <evan@phx.io> Change-Id: I52e3e161f81dcbe8605570e47d732992979c4d34 Reviewed-on: https://go-review.googlesource.com/c/go/+/479623 Run-TryBot: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com>
2023-01-19os: clean up testsBryan C. Mills
- Use testenv.Command instead of exec.Command to try to get more useful timeout behavior. - Parallelize tests that appear not to require global state. (And add explanatory comments for a few that are not parallelizable for subtle reasons.) - Consolidate some “Helper” tests with their parent tests. - Use t.TempDir instead of os.MkdirTemp when appropriate. - Factor out subtests for repeated test helpers. For #36107. Updates #22315. Change-Id: Ic24b6957094dcd40908a59f48e44c8993729222b Reviewed-on: https://go-review.googlesource.com/c/go/+/458015 Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Bryan Mills <bcmills@google.com> Auto-Submit: Bryan Mills <bcmills@google.com>
2020-12-02os: add ReadFile, WriteFile, CreateTemp (was TempFile), MkdirTemp (was ↵Russ Cox
TempDir) from io/ioutil io/ioutil was a poorly defined collection of helpers. Proposal #40025 moved out the generic I/O helpers to io. This CL for proposal #42026 moves the OS-specific helpers to os, making the entire io/ioutil package deprecated. For #42026. Change-Id: I018bcb2115ef2ff1bc7ca36a9247eda429af21ad Reviewed-on: https://go-review.googlesource.com/c/go/+/266364 Trust: Russ Cox <rsc@golang.org> Trust: Emmanuel Odeke <emmanuel@orijtech.com> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>