1 // Copyright 2017 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.
9 // The line numbering of this file is important for TestTBHelper.
11 func notHelper(t
*T
, msg
string) {
15 func helper(t
*T
, msg
string) {
20 func notHelperCallingHelper(t
*T
, msg
string) {
24 func helperCallingHelper(t
*T
, msg
string) {
29 func testHelper(t
*T
) {
30 // Check combinations of directly and indirectly
31 // calling helper functions.
34 notHelperCallingHelper(t
, "2")
35 helperCallingHelper(t
, "3")
37 // Check a function literal closing over t that uses Helper.
38 fn
:= func(msg
string) {
44 // Check that calling Helper from inside this test entry function
45 // doesn't have an effect.
49 t
.Run("sub", func(t
*T
) {
51 notHelperCallingHelper(t
, "7")
57 func parallelTestHelper(t
*T
) {
59 for i
:= 0; i
< 5; i
++ {
62 notHelperCallingHelper(t
, "parallel")