aboutsummaryrefslogtreecommitdiffhomepage
path: root/transform
diff options
context:
space:
mode:
authorDamian Gryski <[email protected]>2022-08-05 16:20:39 -0700
committerRon Evans <[email protected]>2022-08-07 10:32:23 +0200
commitf9ba99344af4143e700c55b381b0adef9d3bb3b2 (patch)
treec79ab1cc18b2b3b55345abdc294e382d5ffe0c42 /transform
parent1784bcd7282aa247aa7fd4a2d3478c920cecdbcf (diff)
downloadtinygo-f9ba99344af4143e700c55b381b0adef9d3bb3b2.tar.gz
tinygo-f9ba99344af4143e700c55b381b0adef9d3bb3b2.zip
all: update _test.go files for ioutil changes
Diffstat (limited to 'transform')
-rw-r--r--transform/allocs_test.go4
-rw-r--r--transform/transform_test.go5
2 files changed, 4 insertions, 5 deletions
diff --git a/transform/allocs_test.go b/transform/allocs_test.go
index f4c86f669..27bb9706a 100644
--- a/transform/allocs_test.go
+++ b/transform/allocs_test.go
@@ -2,7 +2,7 @@ package transform_test
import (
"go/token"
- "io/ioutil"
+ "os"
"path/filepath"
"regexp"
"sort"
@@ -62,7 +62,7 @@ func TestAllocs2(t *testing.T) {
}
// Load expected test output (the OUT: lines).
- testInput, err := ioutil.ReadFile("./testdata/allocs2.go")
+ testInput, err := os.ReadFile("./testdata/allocs2.go")
if err != nil {
t.Fatal("could not read test input:", err)
}
diff --git a/transform/transform_test.go b/transform/transform_test.go
index 1c6b5df39..4cab255e6 100644
--- a/transform/transform_test.go
+++ b/transform/transform_test.go
@@ -6,7 +6,6 @@ import (
"flag"
"go/token"
"go/types"
- "io/ioutil"
"os"
"path/filepath"
"strings"
@@ -58,13 +57,13 @@ func testTransform(t *testing.T, pathPrefix string, transform func(mod llvm.Modu
actual = actual[strings.Index(actual, "\ntarget datalayout = ")+1:]
if *update {
- err := ioutil.WriteFile(pathPrefix+".out.ll", []byte(actual), 0666)
+ err := os.WriteFile(pathPrefix+".out.ll", []byte(actual), 0666)
if err != nil {
t.Error("failed to write out new output:", err)
}
} else {
// Read the expected output IR.
- out, err := ioutil.ReadFile(pathPrefix + ".out.ll")
+ out, err := os.ReadFile(pathPrefix + ".out.ll")
if err != nil {
t.Fatalf("could not read output file %s: %v", pathPrefix+".out.ll", err)
}