Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 

24 Zeilen
620 B

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