forked from quic-go/quic-go
use synctest to make receive stream tests fully deterministc (#5291)
This commit is contained in:
14
internal/synctest/synctest_go124.go
Normal file
14
internal/synctest/synctest_go124.go
Normal file
@@ -0,0 +1,14 @@
|
||||
//go:build go1.24 && !go1.25
|
||||
|
||||
package synctest
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"testing/synctest"
|
||||
)
|
||||
|
||||
func Test(t *testing.T, f func(t *testing.T)) {
|
||||
synctest.Run(func() {
|
||||
f(t)
|
||||
})
|
||||
}
|
||||
12
internal/synctest/synctest_go125.go
Normal file
12
internal/synctest/synctest_go125.go
Normal file
@@ -0,0 +1,12 @@
|
||||
//go:build go1.25
|
||||
|
||||
package synctest
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"testing/synctest"
|
||||
)
|
||||
|
||||
func Test(t *testing.T, f func(t *testing.T)) {
|
||||
synctest.Test(t, f)
|
||||
}
|
||||
Reference in New Issue
Block a user