From 8ce48ed79f8d065a7c859225c535fdbfe57013d6 Mon Sep 17 00:00:00 2001 From: Sergey Tyurin Date: Thu, 23 Apr 2026 12:48:15 -0700 Subject: [PATCH] [synctestx] Fix synctextx.Run signature for go 1.25 --- testing/synctestx/testing.go | 11 ++++++++++- testing/synctestx/testing_test.go | 12 ++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 testing/synctestx/testing_test.go diff --git a/testing/synctestx/testing.go b/testing/synctestx/testing.go index 2619b1b..8048c34 100644 --- a/testing/synctestx/testing.go +++ b/testing/synctestx/testing.go @@ -3,7 +3,16 @@ package synctestx import ( + "testing" "testing/synctest" ) -var Run = synctest.Test +// Run executes a test in synctest context +func Run(t *testing.T, name string, f func(t *testing.T)) { + t.Helper() + t.Run(name, func(t *testing.T) { + synctest.Test(t, func(t *testing.T) { + f(t) + }) + }) +} diff --git a/testing/synctestx/testing_test.go b/testing/synctestx/testing_test.go new file mode 100644 index 0000000..2335066 --- /dev/null +++ b/testing/synctestx/testing_test.go @@ -0,0 +1,12 @@ +package synctestx_test + +import ( + "testing" + + "go.atoms.co/lib/testing/synctestx" +) + +func TestRun(t *testing.T) { + synctestx.Run(t, "run", func(t *testing.T) { + }) +}