mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-06 20:13:40 +00:00
all: update _test.go files for ioutil changes
This commit is contained in:
@@ -5,7 +5,7 @@ package os_test
|
||||
|
||||
import (
|
||||
"io/fs"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
. "os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
@@ -198,13 +198,13 @@ func TestRenameOverwriteDest(t *testing.T) {
|
||||
toData := []byte("to")
|
||||
fromData := []byte("from")
|
||||
|
||||
err := ioutil.WriteFile(to, toData, 0777)
|
||||
err := os.WriteFile(to, toData, 0777)
|
||||
defer Remove(to) // TODO: switch to t.Tempdir, remove this line
|
||||
if err != nil {
|
||||
t.Fatalf("write file %q failed: %v", to, err)
|
||||
}
|
||||
|
||||
err = ioutil.WriteFile(from, fromData, 0777)
|
||||
err = os.WriteFile(from, fromData, 0777)
|
||||
defer Remove(from) // TODO: switch to t.Tempdir, remove this line
|
||||
if err != nil {
|
||||
t.Fatalf("write file %q failed: %v", from, err)
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@ package os_test
|
||||
|
||||
import (
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
. "os"
|
||||
"runtime"
|
||||
"strings"
|
||||
@@ -129,7 +129,7 @@ func TestSeek(t *testing.T) {
|
||||
off, err := f.Seek(tt.in, tt.whence)
|
||||
if off != tt.out || err != nil {
|
||||
if e, ok := err.(*PathError); ok && e.Err == syscall.EINVAL && tt.out > 1<<32 && runtime.GOOS == "linux" {
|
||||
mounts, _ := ioutil.ReadFile("/proc/mounts")
|
||||
mounts, _ := os.ReadFile("/proc/mounts")
|
||||
if strings.Contains(string(mounts), "reiserfs") {
|
||||
// Reiserfs rejects the big seeks.
|
||||
t.Skipf("skipping test known to fail on reiserfs; https://golang.org/issue/91")
|
||||
|
||||
Reference in New Issue
Block a user