aboutsummaryrefslogtreecommitdiff
path: root/src/testing/synctest/synctest_test.go
diff options
context:
space:
mode:
authorDamien Neil <dneil@google.com>2025-06-20 14:44:09 +0100
committerGopher Robot <gobot@golang.org>2025-06-20 12:29:58 -0700
commit49cdf0c42e320dfed044baa551610f081eafb781 (patch)
tree2517ae78483219b5937130a2d12b3237ce423636 /src/testing/synctest/synctest_test.go
parent3bf1eecbd30f48851c35f608aa265c978b2cf301 (diff)
downloadgo-49cdf0c42e320dfed044baa551610f081eafb781.tar.xz
testing, testing/synctest: handle T.Helper in synctest bubbles
Fixes #74199 Change-Id: I6a15fbd59a3a3f8c496440f56d09d695e1504e4e Reviewed-on: https://go-review.googlesource.com/c/go/+/682576 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Alan Donovan <adonovan@google.com> Auto-Submit: Damien Neil <dneil@google.com>
Diffstat (limited to 'src/testing/synctest/synctest_test.go')
-rw-r--r--src/testing/synctest/synctest_test.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/testing/synctest/synctest_test.go b/src/testing/synctest/synctest_test.go
index 822fd6fe1c..9c73178750 100644
--- a/src/testing/synctest/synctest_test.go
+++ b/src/testing/synctest/synctest_test.go
@@ -140,6 +140,18 @@ func TestRun(t *testing.T) {
})
}
+func TestHelper(t *testing.T) {
+ runTest(t, []string{"-test.v"}, func() {
+ synctest.Test(t, func(t *testing.T) {
+ helperLog(t, "log in helper")
+ })
+ }, `^=== RUN TestHelper
+ synctest_test.go:.* log in helper
+--- PASS: TestHelper.*
+PASS
+$`)
+}
+
func wantPanic(t *testing.T, want string) {
if e := recover(); e != nil {
if got := fmt.Sprint(e); got != want {