From: Frédéric G. MARAND Date: Wed, 1 Oct 2025 12:46:16 +0000 (+0000) Subject: testing/synctest: fix inverted test failure message in TestContextAfterFunc X-Git-Tag: go1.26rc1~733 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=3f451f2c54c87db8b8f30e4d5224933f7895f453;p=gostls13.git testing/synctest: fix inverted test failure message in TestContextAfterFunc Fixes #75685 Change-Id: I5592becfde6aaca3d7f0e2f09bc7a9785228523e GitHub-Last-Rev: 0ff7bd31ecfc23222dae70194621397330f3c2da GitHub-Pull-Request: golang/go#75687 Reviewed-on: https://go-review.googlesource.com/c/go/+/708275 Reviewed-by: Alan Donovan Auto-Submit: Alan Donovan LUCI-TryBot-Result: Go LUCI Auto-Submit: Damien Neil Auto-Submit: Sean Liao Reviewed-by: Damien Neil Reviewed-by: Sean Liao --- diff --git a/src/testing/synctest/example_test.go b/src/testing/synctest/example_test.go index 843377ea88..a86d87fcec 100644 --- a/src/testing/synctest/example_test.go +++ b/src/testing/synctest/example_test.go @@ -66,7 +66,7 @@ func TestContextAfterFunc(t *testing.T) { cancel() synctest.Wait() if !afterFuncCalled { - t.Fatalf("before context is canceled: AfterFunc not called") + t.Fatalf("after context is canceled: AfterFunc not called") } }) } diff --git a/src/testing/synctest/synctest.go b/src/testing/synctest/synctest.go index 707383f9c7..9f499515b8 100644 --- a/src/testing/synctest/synctest.go +++ b/src/testing/synctest/synctest.go @@ -147,7 +147,7 @@ // cancel() // synctest.Wait() // if !afterFuncCalled { -// t.Fatalf("before context is canceled: AfterFunc not called") +// t.Fatalf("after context is canceled: AfterFunc not called") // } // }) // }