...
1
2
3
4
5
6
7 package boring_test
8
9 import (
10 "crypto/boring"
11 "runtime"
12 "testing"
13 )
14
15 func TestEnabled(t *testing.T) {
16 supportedPlatform := runtime.GOOS == "linux" && (runtime.GOARCH == "amd64" || runtime.GOARCH == "arm64")
17 if supportedPlatform && !boring.Enabled() {
18 t.Error("Enabled returned false on a supported platform")
19 } else if !supportedPlatform && boring.Enabled() {
20 t.Error("Enabled returned true on an unsupported platform")
21 }
22 }
23
View as plain text