github.com/hxx258456/ccgo@v0.0.5-0.20230213014102-48b35f46f66f/x509/root_omit_test.go (about)

     1  // Copyright 2020 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  //go:build ((darwin && arm64) || (darwin && amd64 && ios)) && x509omitbundledroots
     6  // +build darwin,arm64 darwin,amd64,ios
     7  // +build x509omitbundledroots
     8  
     9  package x509
    10  
    11  import (
    12  	"strings"
    13  	"testing"
    14  )
    15  
    16  func TestOmitBundledRoots(t *testing.T) {
    17  	cp, err := loadSystemRoots()
    18  	if err == nil {
    19  		t.Fatalf("loadSystemRoots = (pool %p, error %v); want non-nil error", cp, err)
    20  	}
    21  	if !strings.Contains(err.Error(), "root bundling disabled") {
    22  		t.Errorf("unexpected error doesn't mention bundling: %v", err)
    23  	}
    24  }