File: quic_test.go

package info (click to toggle)
golang-golang-x-net 1%3A0.27.0-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental, sid, trixie
  • size: 8,636 kB
  • sloc: asm: 18; makefile: 12; sh: 7
file content (37 lines) | stat: -rw-r--r-- 1,144 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright 2023 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.21

package quic

import (
	"testing"
)

func testSides(t *testing.T, name string, f func(*testing.T, connSide)) {
	if name != "" {
		name += "/"
	}
	t.Run(name+"server", func(t *testing.T) { f(t, serverSide) })
	t.Run(name+"client", func(t *testing.T) { f(t, clientSide) })
}

func testStreamTypes(t *testing.T, name string, f func(*testing.T, streamType)) {
	if name != "" {
		name += "/"
	}
	t.Run(name+"bidi", func(t *testing.T) { f(t, bidiStream) })
	t.Run(name+"uni", func(t *testing.T) { f(t, uniStream) })
}

func testSidesAndStreamTypes(t *testing.T, name string, f func(*testing.T, connSide, streamType)) {
	if name != "" {
		name += "/"
	}
	t.Run(name+"server/bidi", func(t *testing.T) { f(t, serverSide, bidiStream) })
	t.Run(name+"client/bidi", func(t *testing.T) { f(t, clientSide, bidiStream) })
	t.Run(name+"server/uni", func(t *testing.T) { f(t, serverSide, uniStream) })
	t.Run(name+"client/uni", func(t *testing.T) { f(t, clientSide, uniStream) })
}