Adding upstream version 0.28.1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
88f1d47ab6
commit
e28c88ef14
933 changed files with 194711 additions and 0 deletions
27
tools/routine/routine_test.go
Normal file
27
tools/routine/routine_test.go
Normal file
|
@ -0,0 +1,27 @@
|
|||
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.")
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue