...
1
2
3
4
5
6
7 package quic
8
9 import (
10 "testing"
11 )
12
13 func testSides(t *testing.T, name string, f func(*testing.T, connSide)) {
14 if name != "" {
15 name += "/"
16 }
17 t.Run(name+"server", func(t *testing.T) { f(t, serverSide) })
18 t.Run(name+"client", func(t *testing.T) { f(t, clientSide) })
19 }
20
21 func testStreamTypes(t *testing.T, name string, f func(*testing.T, streamType)) {
22 if name != "" {
23 name += "/"
24 }
25 t.Run(name+"bidi", func(t *testing.T) { f(t, bidiStream) })
26 t.Run(name+"uni", func(t *testing.T) { f(t, uniStream) })
27 }
28
29 func testSidesAndStreamTypes(t *testing.T, name string, f func(*testing.T, connSide, streamType)) {
30 if name != "" {
31 name += "/"
32 }
33 t.Run(name+"server/bidi", func(t *testing.T) { f(t, serverSide, bidiStream) })
34 t.Run(name+"client/bidi", func(t *testing.T) { f(t, clientSide, bidiStream) })
35 t.Run(name+"server/uni", func(t *testing.T) { f(t, serverSide, uniStream) })
36 t.Run(name+"client/uni", func(t *testing.T) { f(t, clientSide, uniStream) })
37 }
38
View as plain text