Black Lives Matter. Support the Equal Justice Initiative.

Source file src/crypto/x509/root_omit_test.go

Documentation: crypto/x509

     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  }
    25  

View as plain text