1
0
Fork 0
golang-github-pocketbase-po.../tools/routine/routine_test.go
Daniel Baumann e28c88ef14
Adding upstream version 0.28.1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
2025-05-22 10:57:38 +02:00

27 lines
341 B
Go

package routine_test
import (
"sync"
"testing"
"github.com/pocketbase/pocketbase/tools/routine"
)
func TestFireAndForget(t *testing.T) {
called := false
fn := func() {
called = true
panic("test")
}
wg := &sync.WaitGroup{}
routine.FireAndForget(fn, wg)
wg.Wait()
if !called {
t.Error("Expected fn to be called.")
}
}