File: connection_tracer_test.go

package info (click to toggle)
golang-github-lucas-clemente-quic-go 0.54.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,312 kB
  • sloc: sh: 54; makefile: 7
file content (21 lines) | stat: -rw-r--r-- 578 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package logging_test

import (
	"testing"

	"github.com/quic-go/quic-go/logging"

	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
)

func TestConnectionTracerMultiplexing(t *testing.T) {
	var err1, err2 error
	t1 := &logging.ConnectionTracer{ClosedConnection: func(e error) { err1 = e }}
	t2 := &logging.ConnectionTracer{ClosedConnection: func(e error) { err2 = e }}
	tracer := logging.NewMultiplexedConnectionTracer(t1, t2)

	tracer.ClosedConnection(assert.AnError)
	require.Equal(t, assert.AnError, err1)
	require.Equal(t, assert.AnError, err2)
}