use assert.AnError consistently in tests (#5066)

No functional change expected.
This commit is contained in:
Marten Seemann
2025-04-21 09:52:08 +08:00
committed by GitHub
parent d35b5ac187
commit b3f55bb7b7
16 changed files with 77 additions and 84 deletions

View File

@@ -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},