aboutsummaryrefslogtreecommitdiffhomepage
path: root/main_test.go
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2021-08-15 02:29:27 +0200
committerRon Evans <[email protected]>2021-08-30 09:18:58 +0200
commit255f35671d3eef11d6cfe0020aeda5c17985657d (patch)
tree6e24e118a4f658f044ed2fe8b20f24fcf161975f /main_test.go
parent8e88e560a1eb76558364ee3400b3bfe0e4c054c6 (diff)
downloadtinygo-255f35671d3eef11d6cfe0020aeda5c17985657d.tar.gz
tinygo-255f35671d3eef11d6cfe0020aeda5c17985657d.zip
compiler: add support for new language features of Go 1.17
Diffstat (limited to 'main_test.go')
-rw-r--r--main_test.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/main_test.go b/main_test.go
index bbc1a062d..7ebf8eb03 100644
--- a/main_test.go
+++ b/main_test.go
@@ -20,6 +20,7 @@ import (
"github.com/tinygo-org/tinygo/builder"
"github.com/tinygo-org/tinygo/compileopts"
+ "github.com/tinygo-org/tinygo/goenv"
)
const TESTDATA = "testdata"
@@ -54,6 +55,14 @@ func TestCompiler(t *testing.T) {
"zeroalloc.go",
}
+ _, minor, err := goenv.GetGorootVersion(goenv.Get("GOROOT"))
+ if err != nil {
+ t.Fatal("could not read version from GOROOT:", err)
+ }
+ if minor >= 17 {
+ tests = append(tests, "go1.17.go")
+ }
+
if *testTarget != "" {
// This makes it possible to run one specific test (instead of all),
// which is especially useful to quickly check whether some changes