| // Copyright 2017 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| // The line numbering of this file is important for TestTBHelper. |
| func notHelper(t *T, msg string) { |
| func helper(t *T, msg string) { |
| func notHelperCallingHelper(t *T, msg string) { |
| func helperCallingHelper(t *T, msg string) { |
| // Check combinations of directly and indirectly |
| // calling helper functions. |
| notHelperCallingHelper(t, "2") |
| helperCallingHelper(t, "3") |
| // Check a function literal closing over t that uses Helper. |
| // Check that calling Helper from inside this test entry function |
| // doesn't have an effect. |
| t.Run("sub", func(t *T) { |
| notHelperCallingHelper(t, "7") |
| func parallelTestHelper(t *T) { |
| notHelperCallingHelper(t, "parallel") |