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