111 days ago · Tech · hide · Fediverse post

The first time I reached for testing/synctest, I assumed it was a sleep helper with better manners. The public API is small enough to support that assumption: synctest.Test(t, func(t *testing.T) { ... }) synctest.Wait() synctest.Sleep(d) // new in Go 1.27 Three functions, one obvious guess: fake time, wrapped in test scaffolding. That guess is wrong. It isn’t a sleep helper, a goroutine wrapper, or a mocking library. It’s a runtime feature wearing a testing package as a disguise.

Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town