aboutsummaryrefslogtreecommitdiff
path: root/src/crypto/x509/root_omit_test.go
blob: 5ab6c931deb619a7eb4da4b39bea942817cbbc41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright 2020 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// +build darwin,arm64 darwin,amd64,ios
// +build x509omitbundledroots

package x509

import (
	"strings"
	"testing"
)

func TestOmitBundledRoots(t *testing.T) {
	cp, err := loadSystemRoots()
	if err == nil {
		t.Fatalf("loadSystemRoots = (pool %p, error %v); want non-nil error", cp, err)
	}
	if !strings.Contains(err.Error(), "root bundling disabled") {
		t.Errorf("unexpected error doesn't mention bundling: %v", err)
	}
}