// Code generated by testifylint/internal/testgen. DO NOT EDIT.

package errorisas

import (
	"errors"
	"net/http"
	"os"
	"testing"

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

func TestErrorIsAsChecker(t *testing.T) {
	var (
		errSentinel = errors.New("user not found")
		err         error
		target      = new(os.PathError)
	)

	// Invalid.
	{

		assert.Error(t, err, errSentinel)                                  // want "error-is-as: invalid usage of assert\\.Error, use assert\\.ErrorIs instead"
		assert.Error(t, err, errSentinel, "msg")                           // want "error-is-as: invalid usage of assert\\.Error, use assert\\.ErrorIs instead"
		assert.Error(t, err, errSentinel, "msg with arg %d", 42)           // want "error-is-as: invalid usage of assert\\.Error, use assert\\.ErrorIs instead"
		assert.Error(t, err, errSentinel, "msg with args %d %s", 42, "42") // want "error-is-as: invalid usage of assert\\.Error, use assert\\.ErrorIs instead"

		assert.NoError(t, err, errSentinel)                                  // want "error-is-as: invalid usage of assert\\.NoError, use assert\\.NotErrorIs instead"
		assert.NoError(t, err, errSentinel, "msg")                           // want "error-is-as: invalid usage of assert\\.NoError, use assert\\.NotErrorIs instead"
		assert.NoError(t, err, errSentinel, "msg with arg %d", 42)           // want "error-is-as: invalid usage of assert\\.NoError, use assert\\.NotErrorIs instead"
		assert.NoError(t, err, errSentinel, "msg with args %d %s", 42, "42") // want "error-is-as: invalid usage of assert\\.NoError, use assert\\.NotErrorIs instead"

		assert.True(t, errors.Is(err, errSentinel))                                   // want "error-is-as: use assert\\.ErrorIs"
		assert.Truef(t, errors.Is(err, errSentinel), "msg with args %d %s", 42, "42") // want "error-is-as: use assert\\.ErrorIsf"

		assert.False(t, errors.Is(err, errSentinel))                                   // want "error-is-as: use assert\\.NotErrorIs"
		assert.Falsef(t, errors.Is(err, errSentinel), "msg with args %d %s", 42, "42") // want "error-is-as: use assert\\.NotErrorIsf"

		assert.True(t, errors.As(err, &target))                                   // want "error-is-as: use assert\\.ErrorAs"
		assert.Truef(t, errors.As(err, &target), "msg with args %d %s", 42, "42") // want "error-is-as: use assert\\.ErrorAsf"

		assert.False(t, errors.As(err, &target))                                   // want "error-is-as: use assert\\.NotErrorAs"
		assert.Falsef(t, errors.As(err, &target), "msg with args %d %s", 42, "42") // want "error-is-as: use assert\\.NotErrorAsf"

		assert.IsType(t, &http.MaxBytesError{}, err)                                   // want "error-is-as: use assert\\.ErrorIs or assert\\.ErrorAs depending on the case"
		assert.IsTypef(t, &http.MaxBytesError{}, err, "msg with args %d %s", 42, "42") // want "error-is-as: use assert\\.ErrorIs or assert\\.ErrorAs depending on the case"

		assert.IsType(t, (*http.MaxBytesError)(nil), err)                                   // want "error-is-as: use assert\\.ErrorIs or assert\\.ErrorAs depending on the case"
		assert.IsTypef(t, (*http.MaxBytesError)(nil), err, "msg with args %d %s", 42, "42") // want "error-is-as: use assert\\.ErrorIs or assert\\.ErrorAs depending on the case"

		assert.IsType(t, err, os.ErrClosed)                                   // want "error-is-as: use assert\\.ErrorIs or assert\\.ErrorAs depending on the case"
		assert.IsTypef(t, err, os.ErrClosed, "msg with args %d %s", 42, "42") // want "error-is-as: use assert\\.ErrorIs or assert\\.ErrorAs depending on the case"

		assert.IsNotType(t, &http.MaxBytesError{}, err)                                   // want "error-is-as: use assert\\.NotErrorIs or assert\\.NotErrorAs depending on the case"
		assert.IsNotTypef(t, &http.MaxBytesError{}, err, "msg with args %d %s", 42, "42") // want "error-is-as: use assert\\.NotErrorIs or assert\\.NotErrorAs depending on the case"

		assert.IsNotType(t, (*http.MaxBytesError)(nil), err)                                   // want "error-is-as: use assert\\.NotErrorIs or assert\\.NotErrorAs depending on the case"
		assert.IsNotTypef(t, (*http.MaxBytesError)(nil), err, "msg with args %d %s", 42, "42") // want "error-is-as: use assert\\.NotErrorIs or assert\\.NotErrorAs depending on the case"

		assert.IsNotType(t, err, os.ErrClosed)                                   // want "error-is-as: use assert\\.NotErrorIs or assert\\.NotErrorAs depending on the case"
		assert.IsNotTypef(t, err, os.ErrClosed, "msg with args %d %s", 42, "42") // want "error-is-as: use assert\\.NotErrorIs or assert\\.NotErrorAs depending on the case"
	}

	// Valid.
	{
		assert.Error(t, err)
		assert.Error(t, err, "msg")
		assert.Error(t, err, "msg with arg %d", 42)
		assert.Error(t, err, "msg with args %d %s", 42, "42")
		assert.Errorf(t, err, "msg")
		assert.Errorf(t, err, "msg with arg %d", 42)
		assert.Errorf(t, err, "msg with args %d %s", 42, "42")

		assert.NoError(t, err)
		assert.NoError(t, err, "msg")
		assert.NoError(t, err, "msg with arg %d", 42)
		assert.NoError(t, err, "msg with args %d %s", 42, "42")
		assert.NoErrorf(t, err, "msg")
		assert.NoErrorf(t, err, "msg with arg %d", 42)
		assert.NoErrorf(t, err, "msg with args %d %s", 42, "42")

		assert.ErrorIs(t, err, errSentinel)
		assert.ErrorIs(t, err, errSentinel, "msg")
		assert.ErrorIs(t, err, errSentinel, "msg with arg %d", 42)
		assert.ErrorIs(t, err, errSentinel, "msg with args %d %s", 42, "42")
		assert.ErrorIsf(t, err, errSentinel, "msg")
		assert.ErrorIsf(t, err, errSentinel, "msg with arg %d", 42)
		assert.ErrorIsf(t, err, errSentinel, "msg with args %d %s", 42, "42")

		assert.NotErrorIs(t, err, errSentinel)
		assert.NotErrorIs(t, err, errSentinel, "msg")
		assert.NotErrorIs(t, err, errSentinel, "msg with arg %d", 42)
		assert.NotErrorIs(t, err, errSentinel, "msg with args %d %s", 42, "42")
		assert.NotErrorIsf(t, err, errSentinel, "msg")
		assert.NotErrorIsf(t, err, errSentinel, "msg with arg %d", 42)
		assert.NotErrorIsf(t, err, errSentinel, "msg with args %d %s", 42, "42")

		assert.ErrorAs(t, err, &target)
		assert.ErrorAs(t, err, &target, "msg")
		assert.ErrorAs(t, err, &target, "msg with arg %d", 42)
		assert.ErrorAs(t, err, &target, "msg with args %d %s", 42, "42")
		assert.ErrorAsf(t, err, &target, "msg")
		assert.ErrorAsf(t, err, &target, "msg with arg %d", 42)
		assert.ErrorAsf(t, err, &target, "msg with args %d %s", 42, "42")

		assert.ErrorAs(t, err, new(*http.MaxBytesError))
		assert.ErrorAs(t, err, new(*http.MaxBytesError), "msg")
		assert.ErrorAs(t, err, new(*http.MaxBytesError), "msg with arg %d", 42)
		assert.ErrorAs(t, err, new(*http.MaxBytesError), "msg with args %d %s", 42, "42")
		assert.ErrorAsf(t, err, new(*http.MaxBytesError), "msg")
		assert.ErrorAsf(t, err, new(*http.MaxBytesError), "msg with arg %d", 42)
		assert.ErrorAsf(t, err, new(*http.MaxBytesError), "msg with args %d %s", 42, "42")

		assert.NotErrorAs(t, err, &target)
		assert.NotErrorAs(t, err, &target, "msg")
		assert.NotErrorAs(t, err, &target, "msg with arg %d", 42)
		assert.NotErrorAs(t, err, &target, "msg with args %d %s", 42, "42")
		assert.NotErrorAsf(t, err, &target, "msg")
		assert.NotErrorAsf(t, err, &target, "msg with arg %d", 42)
		assert.NotErrorAsf(t, err, &target, "msg with args %d %s", 42, "42")

		assert.NotErrorAs(t, err, new(*http.MaxBytesError))
		assert.NotErrorAs(t, err, new(*http.MaxBytesError), "msg")
		assert.NotErrorAs(t, err, new(*http.MaxBytesError), "msg with arg %d", 42)
		assert.NotErrorAs(t, err, new(*http.MaxBytesError), "msg with args %d %s", 42, "42")
		assert.NotErrorAsf(t, err, new(*http.MaxBytesError), "msg")
		assert.NotErrorAsf(t, err, new(*http.MaxBytesError), "msg with arg %d", 42)
		assert.NotErrorAsf(t, err, new(*http.MaxBytesError), "msg with args %d %s", 42, "42")
	}
}
