...
1 package platform
2
3 import (
4 "runtime"
5 "testing"
6
7 "github.com/tetratelabs/wazero/internal/testing/require"
8 )
9
10 func Test_archRequirementsVerified(t *testing.T) {
11 switch runtime.GOARCH {
12 case "arm64":
13 require.True(t, archRequirementsVerified)
14 case "amd64":
15
16
17
18 require.True(t, archRequirementsVerified)
19 default:
20 require.False(t, archRequirementsVerified)
21 }
22 }
23
24 func Test_isAtLeastGo120(t *testing.T) {
25 tests := []struct {
26 input string
27 expected bool
28 }{
29 {input: "go1.18.10", expected: false},
30 {input: "go1.19.10", expected: false},
31 {input: "go1.20.5", expected: true},
32 {input: "devel go1.21-39c50707 Thu Jul 6 23:23:41 2023 +0000", expected: true},
33 {input: "go1.21rc2", expected: true},
34 {input: "go1.90.10", expected: true},
35 {input: "go2.0.0", expected: false},
36 }
37
38 for _, tt := range tests {
39 tc := tt
40
41 require.Equal(t, tc.expected, isAtLeastGo120(tc.input), tc.input)
42 }
43 }
44
View as plain text