github.com/go-xe2/third@v1.0.3/golang.org/x/text/internal/testtext/go1_6.go (about)

     1  // Copyright 2016 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  // +build !go1.7
     6  
     7  package testtext
     8  
     9  import "testing"
    10  
    11  func Run(t *testing.T, name string, fn func(t *testing.T)) bool {
    12  	t.Logf("Running %s...", name)
    13  	fn(t)
    14  	return t.Failed()
    15  }
    16  
    17  // Bench runs the given benchmark function. This pre-1.7 implementation renders
    18  // the measurement useless, but allows the code to be compiled at least.
    19  func Bench(b *testing.B, name string, fn func(b *testing.B)) bool {
    20  	b.Logf("Running %s...", name)
    21  	fn(b)
    22  	return b.Failed()
    23  }