aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDamian Gryski <[email protected]>2022-08-05 16:21:07 -0700
committerRon Evans <[email protected]>2022-08-07 10:32:23 +0200
commitf12ddfe164dad9a6d1752c90388dbe3ef976b954 (patch)
tree18e59bc412e629063b50d5444fca4b3f9be5eca8
parentf9ba99344af4143e700c55b381b0adef9d3bb3b2 (diff)
downloadtinygo-f12ddfe164dad9a6d1752c90388dbe3ef976b954.tar.gz
tinygo-f12ddfe164dad9a6d1752c90388dbe3ef976b954.zip
all: update _test.go files for os.IsFoo changes
-rw-r--r--compileopts/target_test.go5
-rw-r--r--src/testing/testing_test.go6
2 files changed, 7 insertions, 4 deletions
diff --git a/compileopts/target_test.go b/compileopts/target_test.go
index 8f7b99b2e..579c54f67 100644
--- a/compileopts/target_test.go
+++ b/compileopts/target_test.go
@@ -1,7 +1,8 @@
package compileopts
import (
- "os"
+ "errors"
+ "io/fs"
"reflect"
"testing"
)
@@ -17,7 +18,7 @@ func TestLoadTarget(t *testing.T) {
t.Error("LoadTarget should have failed with non existing target")
}
- if !os.IsNotExist(err) {
+ if !errors.Is(err, fs.ErrNotExist) {
t.Error("LoadTarget failed for wrong reason:", err)
}
}
diff --git a/src/testing/testing_test.go b/src/testing/testing_test.go
index 91816b638..3ab324262 100644
--- a/src/testing/testing_test.go
+++ b/src/testing/testing_test.go
@@ -10,6 +10,8 @@
package testing_test
import (
+ "errors"
+ "io/fs"
"os"
"path/filepath"
"testing"
@@ -42,7 +44,7 @@ func TestTempDirInCleanup(t *testing.T) {
if fi != nil {
t.Fatalf("Directory %q from user Cleanup still exists", dir)
}
- if !os.IsNotExist(err) {
+ if !errors.Is(err, fs.ErrNotExist) {
t.Fatalf("Unexpected error: %v", err)
}
}
@@ -85,7 +87,7 @@ func testTempDir(t *testing.T) {
select {
case dir := <-dirCh:
fi, err := os.Stat(dir)
- if os.IsNotExist(err) {
+ if errors.Is(err, fs.ErrNotExist) {
// All good
return
}