forked from quic-go/quic-go
use assert.AnError consistently in tests (#5066)
No functional change expected.
This commit is contained in:
@@ -1,24 +1,22 @@
|
||||
package http3
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"testing"
|
||||
|
||||
"github.com/quic-go/quic-go"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestErrorConversion(t *testing.T) {
|
||||
regularErr := errors.New("foobar")
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
input error
|
||||
expected error
|
||||
}{
|
||||
{name: "nil error", input: nil, expected: nil},
|
||||
{name: "regular error", input: regularErr, expected: regularErr},
|
||||
{name: "regular error", input: assert.AnError, expected: assert.AnError},
|
||||
{
|
||||
name: "stream error",
|
||||
input: &quic.StreamError{ErrorCode: 1337, Remote: true},
|
||||
|
||||
Reference in New Issue
Block a user