// SPDX-FileCopyrightText: Copyright 2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

// Code generated with github.com/go-openapi/testify/codegen/v2; DO NOT EDIT.

package assert

import (
	"iter"
	"net/http"
	"net/url"
	"reflect"
	"time"

	"github.com/go-openapi/testify/v2/internal/assertions"
)

// Blocked asserts that a channel is blocked on receive.
//
// It always fails if the operand is not a channel, or if the channel is send-only.
//
// # Usage
//
//	ch := make(chan struct{})
//	assertions.Blocked(t, ch)
//
// # Examples
//
//	success:  make(chan struct{})
//	failure:  sendChanMessage()
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Blocked(t T, ch any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.Blocked(t, ch, msgAndArgs...)
}

// BlockedT asserts that a channel is blocked on receive.
//
// # Usage
//
//	ch := make(chan struct{})
//	assertions.BlockedT(t, ch)
//
// # Examples
//
//	success:  make(chan struct{})
//	failure:  sendChanMessage()
//
// Upon failure, the test [T] is marked as failed and continues execution.
func BlockedT[E any, CHAN ~chan E](t T, ch CHAN, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.BlockedT[E, CHAN](t, ch, msgAndArgs...)
}

// Condition uses a comparison function to assert a complex condition.
//
// # Usage
//
//	assertions.Condition(t, func() bool { return myCondition })
//
// # Examples
//
//	success:  func() bool { return true }
//	failure:  func() bool { return false }
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Condition(t T, comp func() bool, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.Condition(t, comp, msgAndArgs...)
}

// Consistently asserts that the given condition is always satisfied until timeout,
// periodically checking the target function at each tick.
//
// [Consistently] ("always") imposes a stronger constraint than [Eventually] ("at least once"):
// it checks at every tick that every occurrence of the condition is satisfied, whereas
// [Eventually] succeeds on the first occurrence of a successful condition.
//
// # Usage
//
//	assertions.Consistently(t, func() bool { return true }, time.Second, 10*time.Millisecond)
//
// See also [Eventually] for details about using context, concurrency, and panic recovery.
//
// # Alternative condition signature
//
// The simplest form of condition is:
//
//	func() bool
//
// The semantics of the assertion are "always returns true".
//
// To build more complex cases, a condition may also be defined as:
//
//	func(context.Context) error
//
// It fails as soon as an error is returned before timeout expressing "always returns no error (nil)"
//
// This is consistent with [Eventually] expressing "eventually returns no error (nil)".
//
// It will be executed with the context of the assertion, which inherits the [testing.T.Context] and
// is cancelled on timeout.
//
// # Panic recovery
//
// A panicking condition is treated as an error, causing [Consistently] to fail immediately.
// See [Eventually] for details.
//
// # Concurrency
//
// See [Eventually].
//
// # Attention point
//
// See [Eventually].
//
// # Synctest (opt-in)
//
// Wrap the condition with [WithSynctest] (or [WithSynctestContext]) to run
// the polling loop inside a [testing/synctest] bubble, which uses a fake
// clock. This eliminates timing-induced flakiness and makes the tick count
// deterministic. See [WithSynctest] for the constraints (no real I/O in
// the condition, requires [*testing.T]).
//
// # Examples
//
//	success:  func() bool { return true }, 100*time.Millisecond, 20*time.Millisecond
//	failure:  func() bool { return false }, 100*time.Millisecond, 20*time.Millisecond
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Consistently[C Conditioner](t T, condition C, timeout time.Duration, tick time.Duration, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.Consistently[C](t, condition, timeout, tick, msgAndArgs...)
}

// Contains asserts that the specified string, list(array, slice...) or map contains the
// specified substring or element.
//
// # Usage
//
//	assertions.Contains(t, "Hello World", "World")
//	assertions.Contains(t, []string{"Hello", "World"}, "World")
//	assertions.Contains(t, map[string]string{"Hello": "World"}, "Hello")
//
// # Examples
//
//	success: []string{"A","B"}, "A"
//	failure: []string{"A","B"}, "C"
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Contains(t T, s any, contains any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.Contains(t, s, contains, msgAndArgs...)
}

// DirExists checks whether a directory exists in the given path. It also fails
// if the path is a file rather a directory or there is an error checking whether it exists.
//
// # Usage
//
//	assertions.DirExists(t, "path/to/directory")
//
// # Examples
//
//	success: filepath.Join(testDataPath(),"existing_dir")
//	failure: filepath.Join(testDataPath(),"non_existing_dir")
//
// Upon failure, the test [T] is marked as failed and continues execution.
func DirExists(t T, path string, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.DirExists(t, path, msgAndArgs...)
}

// DirNotExists checks whether a directory does not exist in the given path.
// It fails if the path points to an existing _directory_ only.
//
// # Usage
//
//	assertions.DirNotExists(t, "path/to/directory")
//
// # Examples
//
//	success: filepath.Join(testDataPath(),"non_existing_dir")
//	failure: filepath.Join(testDataPath(),"existing_dir")
//
// Upon failure, the test [T] is marked as failed and continues execution.
func DirNotExists(t T, path string, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.DirNotExists(t, path, msgAndArgs...)
}

// ElementsMatch asserts that the specified listA(array, slice...) is equal to specified
// listB(array, slice...) ignoring the order of the elements. If there are duplicate elements,
// the number of appearances of each of them in both lists should match.
//
// # Usage
//
//	assertions.ElementsMatch(t, []int{1, 3, 2, 3}, []int{1, 3, 3, 2})
//
// # Examples
//
//	success: []int{1, 3, 2, 3}, []int{1, 3, 3, 2}
//	failure: []int{1, 2, 3}, []int{1, 2, 4}
//
// Upon failure, the test [T] is marked as failed and continues execution.
func ElementsMatch(t T, listA any, listB any, msgAndArgs ...any) (ok bool) {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.ElementsMatch(t, listA, listB, msgAndArgs...)
}

// ElementsMatchT asserts that the specified listA(array, slice...) is equal to specified
// listB(array, slice...) ignoring the order of the elements. If there are duplicate elements,
// the number of appearances of each of them in both lists should match.
//
// # Usage
//
//	assertions.ElementsMatchT(t, []int{1, 3, 2, 3}, []int{1, 3, 3, 2})
//
// # Examples
//
//	success: []int{1, 3, 2, 3}, []int{1, 3, 3, 2}
//	failure: []int{1, 2, 3}, []int{1, 2, 4}
//
// Upon failure, the test [T] is marked as failed and continues execution.
func ElementsMatchT[E comparable](t T, listA []E, listB []E, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.ElementsMatchT[E](t, listA, listB, msgAndArgs...)
}

// Empty asserts that the given value is "empty".
//
// Zero values are "empty".
//
// Arrays are "empty" if every element is the zero value of the type (stricter than "empty").
//
// Slices, maps and channels with zero length are "empty".
//
// Pointer values are "empty" if the pointer is nil or if the pointed value is "empty".
//
// # Usage
//
//	assertions.Empty(t, obj)
//
// # Examples
//
//	success: ""
//	failure: "not empty"
//
// Upon failure, the test [T] is marked as failed and continues execution.
//
// [Zero values]: https://go.dev/ref/spec#The_zero_value
func Empty(t T, object any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.Empty(t, object, msgAndArgs...)
}

// Equal asserts that two objects are equal.
//
// Pointer variable equality is determined based on the equality of the
// referenced values (as opposed to the memory addresses).
//
// Function equality cannot be determined and will always fail.
//
// # Usage
//
//	assertions.Equal(t, 123, 123)
//
// # Examples
//
//	success: 123, 123
//	failure: 123, 456
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Equal(t T, expected any, actual any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.Equal(t, expected, actual, msgAndArgs...)
}

// EqualError asserts that a function returned a non-nil error (i.e. an error)
// and that it is equal to the provided error.
//
// # Usage
//
//	actualObj, err := SomeFunction()
//	assertions.EqualError(t, err,  expectedErrorString)
//
// # Examples
//
//	success: ErrTest, "assert.ErrTest general error for testing"
//	failure: ErrTest, "wrong error message"
//
// Upon failure, the test [T] is marked as failed and continues execution.
func EqualError(t T, err error, errString string, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.EqualError(t, err, errString, msgAndArgs...)
}

// EqualExportedValues asserts that the types of two objects are equal and their public
// fields are also equal.
//
// This is useful for comparing structs that have private fields that could potentially differ.
//
// Function equality cannot be determined and will always fail.
//
// # Usage
//
//	type S struct {
//		Exported     	int
//		notExported   	int
//	}
//	assertions.EqualExportedValues(t, S{1, 2}, S{1, 3}) => true
//	assertions.EqualExportedValues(t, S{1, 2}, S{2, 3}) => false
//
// # Examples
//
//	success: &dummyStruct{A: "a", b: 1}, &dummyStruct{A: "a", b: 2}
//	failure: &dummyStruct{A: "a", b: 1}, &dummyStruct{A: "b", b: 1}
//
// Upon failure, the test [T] is marked as failed and continues execution.
func EqualExportedValues(t T, expected any, actual any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.EqualExportedValues(t, expected, actual, msgAndArgs...)
}

// EqualT asserts that two objects of the same comparable type are equal.
//
// Pointer variable equality is determined based on the equality of the memory addresses (unlike [Equal], but like [Same]).
//
// Functions, slices and maps are not comparable. See also [ComparisonOperators].
//
// If you need to compare values of non-comparable types, or compare pointers by the value they point to,
// use [Equal] instead.
//
// # Usage
//
//	assertions.EqualT(t, 123, 123)
//
// # Examples
//
//	success: 123, 123
//	failure: 123, 456
//
// Upon failure, the test [T] is marked as failed and continues execution.
//
// [ComparisonOperators]: https://go.dev/ref/spec#Comparison_operators.
func EqualT[V comparable](t T, expected V, actual V, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.EqualT[V](t, expected, actual, msgAndArgs...)
}

// EqualValues asserts that two objects are equal or convertible to the larger
// type and equal.
//
// Function equality cannot be determined and will always fail.
//
// # Usage
//
//	assertions.EqualValues(t, uint32(123), int32(123))
//
// # Examples
//
//	success: uint32(123), int32(123)
//	failure: uint32(123), int32(456)
//
// Upon failure, the test [T] is marked as failed and continues execution.
func EqualValues(t T, expected any, actual any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.EqualValues(t, expected, actual, msgAndArgs...)
}

// Error asserts that a function returned a non-nil error (i.e. an error).
//
// # Usage
//
//	actualObj, err := SomeFunction()
//	assertions.Error(t, err)
//
// # Examples
//
//	success: ErrTest
//	failure: nil
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Error(t T, err error, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.Error(t, err, msgAndArgs...)
}

// ErrorAs asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value.
//
// This is a wrapper for [errors.As].
//
// # Usage
//
//	assertions.ErrorAs(t, err, &target)
//
// # Examples
//
//	success: fmt.Errorf("wrap: %w", &dummyError{}), new(*dummyError)
//	failure: ErrTest, new(*dummyError)
//
// Upon failure, the test [T] is marked as failed and continues execution.
func ErrorAs(t T, err error, target any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.ErrorAs(t, err, target, msgAndArgs...)
}

// ErrorAsType asserts that at least one of the errors in err's chain is of type E.
//
// It is the type-safe counterpart of [ErrorAs], built on the go1.26 [errors.AsType]:
// the expected type is the type parameter E (checked at compile time, no reflection),
// rather than the untyped any target used by [ErrorAs].
//
// target receives the matched error when the assertion succeeds. It may be nil, for
// callers that only want to know whether the chain holds an error of type E: in that
// case E cannot be inferred and must be supplied explicitly.
//
// This assertion requires go1.26 or newer; it is unavailable on older toolchains.
//
// # Usage
//
//	// capture the matched error (E is inferred from target):
//	var target *MyError
//	assertions.ErrorAsType(t, err, &target)
//
//	// only check, discarding the value (E given explicitly):
//	assertions.ErrorAsType[*MyError](t, err, nil)
//
// # Examples
//
//	success: fmt.Errorf("wrap: %w", &dummyError{}), new(*dummyError)
//	failure: ErrTest, new(*dummyError)
//
// Upon failure, the test [T] is marked as failed and continues execution.
func ErrorAsType[E error](t T, err error, target *E, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.ErrorAsType[E](t, err, target, msgAndArgs...)
}

// ErrorContains asserts that a function returned a non-nil error (i.e. an
// error) and that the error contains the specified substring.
//
// # Usage
//
//	actualObj, err := SomeFunction()
//	assertions.ErrorContains(t, err,  expectedErrorSubString)
//
// # Examples
//
//	success: ErrTest, "general error"
//	failure: ErrTest, "not in message"
//
// Upon failure, the test [T] is marked as failed and continues execution.
func ErrorContains(t T, err error, contains string, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.ErrorContains(t, err, contains, msgAndArgs...)
}

// ErrorIs asserts that at least one of the errors in err's chain matches target.
//
// This is a wrapper for [errors.Is].
//
// # Usage
//
//	assertions.ErrorIs(t, err, io.EOF)
//
// # Examples
//
//	success: fmt.Errorf("wrap: %w", io.EOF), io.EOF
//	failure: ErrTest, io.EOF
//
// Upon failure, the test [T] is marked as failed and continues execution.
func ErrorIs(t T, err error, target error, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.ErrorIs(t, err, target, msgAndArgs...)
}

// ErrorNotContains asserts that a function returned a non-nil error (i.e. an
// error) and that the error does not contain the specified substring.
//
// A nil error fails this assertion. Use [NoError] to assert that a function
// returned no error at all.
//
// # Usage
//
//	actualObj, err := SomeFunction()
//	assertions.ErrorNotContains(t, err, unexpectedErrorSubString)
//
// # Examples
//
//	success: ErrTest, "not in message"
//	failure: ErrTest, "general error"
//
// Upon failure, the test [T] is marked as failed and continues execution.
func ErrorNotContains(t T, err error, contains string, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.ErrorNotContains(t, err, contains, msgAndArgs...)
}

// Eventually asserts that the given condition will be met before timeout,
// periodically checking the target function on each tick.
//
// [Eventually] waits until the condition returns true, at most until timeout,
// or until the parent context of the test is cancelled.
//
// If the condition takes longer than the timeout to complete, [Eventually] fails
// but waits for the current condition execution to finish before returning.
//
// For long-running conditions to be interrupted early, check [testing.T.Context]
// which is cancelled on test failure.
//
// # Usage
//
//	assertions.Eventually(t, func() bool { return true }, time.Second, 10*time.Millisecond)
//
// # Alternative condition signature
//
// The simplest form of condition is:
//
//	func() bool
//
// To build more complex cases, a condition may also be defined as:
//
//	func(context.Context) error
//
// It fails when an error has always been returned up to timeout (equivalent semantics to func() bool returns false),
// expressing "eventually returns no error (nil)".
//
// It will be executed with the context of the assertion, which inherits the [testing.T.Context] and
// is cancelled on timeout.
//
// The semantics of the three available async assertions read as follows.
//
//   - [Eventually] (func() bool) : "eventually returns true"
//
//   - [Never] (func() bool) : "never returns true"
//
//   - [Consistently] (func() bool): "always returns true"
//
//   - [Eventually] (func(ctx) error) : "eventually returns nil"
//
//   - [Never] (func(ctx) error) : not supported, use [Consistently] instead (avoids confusion with double negation)
//
//   - [Consistently] (func(ctx) error): "always returns nil"
//
// # Concurrency
//
// The condition function is always executed serially by a single goroutine. It is always executed at least once.
//
// It may thus write to variables outside its scope without triggering race conditions.
//
// A blocking condition will cause [Eventually] to hang until it returns.
//
// Notice that time ticks may be skipped if the condition takes longer than the tick interval.
//
// # Panic recovery
//
// If the condition panics, the panic is recovered and treated as a failed tick
// (equivalent to returning false or a non-nil error). For [Eventually], this means
// the poller retries on the next tick — if a later tick succeeds, the assertion
// succeeds. For [Never] and [Consistently], a panic is treated as the condition
// erroring, which causes immediate failure.
//
// The recovered panic is wrapped as an error with the sentinel [errConditionPanicked],
// detectable with [errors.Is].
//
// # Attention point
//
// Time-based tests may be flaky in a resource-constrained environment such as a CI runner and may produce
// counter-intuitive results, such as ticks or timeouts not firing in time as expected.
//
// To avoid flaky tests, always make sure that ticks and timeouts differ by at least an order of magnitude (tick <<
// timeout).
//
// # Synctest (opt-in)
//
// Wrap the condition with [WithSynctest] (or [WithSynctestContext]) to run
// the polling loop inside a [testing/synctest] bubble, which uses a fake
// clock. This eliminates timing-induced flakiness and makes the tick count
// deterministic. See [WithSynctest] for the constraints (no real I/O in
// the condition, requires `*testing.T`).
//
// # Examples
//
//	success:  func() bool { return true }, 100*time.Millisecond, 20*time.Millisecond
//	failure:  func() bool { return false }, 100*time.Millisecond, 20*time.Millisecond
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Eventually[C Conditioner](t T, condition C, timeout time.Duration, tick time.Duration, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.Eventually[C](t, condition, timeout, tick, msgAndArgs...)
}

// EventuallyWith asserts that the given condition will be met before the timeout,
// periodically checking the target function at each tick.
//
// In contrast to [Eventually], the condition function is supplied with a [CollectT]
// to accumulate errors from calling other assertions.
//
// The condition is considered "met" if no errors are raised in a tick.
// The supplied [CollectT] collects all errors from one tick.
//
// If the condition is not met before the timeout, the collected errors from the
// last tick are copied to t.
//
// Calling [CollectT.FailNow] (directly, or transitively through [require] assertions)
// fails the current tick only: the poller will retry on the next tick. This means
// [require]-style assertions inside [EventuallyWith] behave naturally — they abort
// the current evaluation and let the polling loop converge.
//
// To abort the whole assertion immediately (e.g. when the condition can no longer
// be expected to succeed), call [CollectT.Cancel].
//
// # Usage
//
//	externalValue := false
//	go func() {
//		time.Sleep(8*time.Second)
//		externalValue = true
//	}()
//
//	assertions.EventuallyWith(t, func(c *assertions.CollectT) {
//		// add assertions as needed; any assertion failure will fail the current tick
//		assertions.True(c, externalValue, "expected 'externalValue' to be true")
//	},
//	10*time.Second,
//	1*time.Second,
//	"external state has not changed to 'true'; still false",
//	)
//
// # Concurrency
//
// The condition function is never executed in parallel: only one goroutine executes it.
// It may write to variables outside its scope without triggering race conditions.
//
// The condition is wrapped in its own goroutine, so a call to [runtime.Goexit]
// (e.g. via [require] assertions or [CollectT.FailNow]) cleanly aborts only the
// current tick.
//
// # Panic recovery
//
// If the condition panics, the panic is recovered and recorded as an error in the
// [CollectT] for that tick. The poller treats it as a failed tick and retries on the
// next one. If the assertion times out, the panic error is included in the collected
// errors reported on the parent t.
//
// See [Eventually] for the general panic recovery semantics.
//
// # Synctest (opt-in)
//
// Wrap the condition with [WithSynctestCollect] (or [WithSynctestCollectContext])
// to run the polling loop inside a [testing/synctest] bubble, which uses
// a fake clock. This eliminates timing-induced flakiness and makes the
// tick count deterministic. See [WithSynctest] for the constraints (no
// real I/O in the condition, requires [*testing.T]).
//
// # Examples
//
//	success: func(c *CollectT) { True(c,true) }, 100*time.Millisecond, 20*time.Millisecond
//	failure: func(c *CollectT) { False(c,true) }, 100*time.Millisecond, 20*time.Millisecond
//	failure: func(c *CollectT) { c.Cancel() }, 100*time.Millisecond, 20*time.Millisecond
//
// Upon failure, the test [T] is marked as failed and continues execution.
func EventuallyWith[C CollectibleConditioner](t T, condition C, timeout time.Duration, tick time.Duration, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.EventuallyWith[C](t, condition, timeout, tick, msgAndArgs...)
}

// Exactly asserts that two objects are equal in value and type.
//
// # Usage
//
//	assertions.Exactly(t, int32(123), int64(123))
//
// # Examples
//
//	success: int32(123), int32(123)
//	failure: int32(123), int64(123)
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Exactly(t T, expected any, actual any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.Exactly(t, expected, actual, msgAndArgs...)
}

// Fail reports a failure through.
//
// # Usage
//
//	assertions.Fail(t, "failed")
//
// # Examples
//
//	failure: "failed"
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Fail(t T, failureMessage string, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.Fail(t, failureMessage, msgAndArgs...)
}

// FailNow fails test.
//
// # Usage
//
//	assertions.FailNow(t, "failed")
//
// # Examples
//
//	failure: "failed"
//
// Upon failure, the test [T] is marked as failed and continues execution.
func FailNow(t T, failureMessage string, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.FailNow(t, failureMessage, msgAndArgs...)
}

// False asserts that the specified value is false.
//
// # Usage
//
//	assertions.False(t, myBool)
//
// # Examples
//
//	success: 1 == 0
//	failure: 1 == 1
//
// Upon failure, the test [T] is marked as failed and continues execution.
func False(t T, value bool, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.False(t, value, msgAndArgs...)
}

// FalseT asserts that the specified value is false.
//
// The type constraint [Boolean] accepts any type which underlying type is bool.
//
// # Usage
//
//	type B bool
//	var b B = true
//
//	assertions.FalseT(t, b)
//
// # Examples
//
//	success: 1 == 0
//	failure: 1 == 1
//
// Upon failure, the test [T] is marked as failed and continues execution.
func FalseT[B Boolean](t T, value B, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.FalseT[B](t, value, msgAndArgs...)
}

// FileEmpty checks whether a file exists in the given path and is empty.
// It fails if the file is not empty, if the path points to a directory or there is an error when trying to check the file.
//
// # Usage
//
//	assertions.FileEmpty(t, "path/to/file")
//
// # Examples
//
//	success: filepath.Join(testDataPath(),"empty_file")
//	failure: filepath.Join(testDataPath(),"existing_file")
//
// Upon failure, the test [T] is marked as failed and continues execution.
func FileEmpty(t T, path string, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.FileEmpty(t, path, msgAndArgs...)
}

// FileExists checks whether a file exists in the given path. It also fails if
// the path points to a directory or there is an error when trying to check the file.
//
// # Usage
//
//	assertions.FileExists(t, "path/to/file")
//
// # Examples
//
//	success: filepath.Join(testDataPath(),"existing_file")
//	failure: filepath.Join(testDataPath(),"non_existing_file")
//
// Upon failure, the test [T] is marked as failed and continues execution.
func FileExists(t T, path string, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.FileExists(t, path, msgAndArgs...)
}

// FileNotEmpty checks whether a file exists in the given path and is not empty.
// It fails if the file is empty, if the path points to a directory or there is an error when trying to check the file.
//
// # Usage
//
//	assertions.FileNotEmpty(t, "path/to/file")
//
// # Examples
//
//	success: filepath.Join(testDataPath(),"existing_file")
//	failure: filepath.Join(testDataPath(),"empty_file")
//
// Upon failure, the test [T] is marked as failed and continues execution.
func FileNotEmpty(t T, path string, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.FileNotEmpty(t, path, msgAndArgs...)
}

// FileNotExists checks whether a file does not exist in a given path. It fails
// if the path points to an existing _file_ only.
//
// # Usage
//
//	assertions.FileNotExists(t, "path/to/file")
//
// # Examples
//
//	success: filepath.Join(testDataPath(),"non_existing_file")
//	failure: filepath.Join(testDataPath(),"existing_file")
//
// Upon failure, the test [T] is marked as failed and continues execution.
func FileNotExists(t T, path string, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.FileNotExists(t, path, msgAndArgs...)
}

// Greater asserts that the first element is strictly greater than the second.
//
// Both elements must be of the same type in the [reflect.Kind] sense.
// To compare values that need a type conversion (e.g. float32 against float64), you need to convert types beforehand.
//
// # Usage
//
//	assertions.Greater(t, 2, 1)
//	assertions.Greater(t, float64(2), float64(1))
//	assertions.Greater(t, "b", "a")
//
// # Examples
//
//	success: 2, 1
//	failure: 1, 2
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Greater(t T, e1 any, e2 any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.Greater(t, e1, e2, msgAndArgs...)
}

// GreaterOrEqual asserts that the first element is greater than or equal to the second.
//
// See also [Greater].
//
// # Usage
//
//	assertions.GreaterOrEqual(t, 2, 1)
//	assertions.GreaterOrEqual(t, 2, 2)
//	assertions.GreaterOrEqual(t, "b", "a")
//	assertions.GreaterOrEqual(t, "b", "b")
//
// # Examples
//
//	success: 2, 1
//	failure: 1, 2
//
// Upon failure, the test [T] is marked as failed and continues execution.
func GreaterOrEqual(t T, e1 any, e2 any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.GreaterOrEqual(t, e1, e2, msgAndArgs...)
}

// GreaterOrEqualT asserts that for two elements of the same type,
// the first element is greater than or equal to the second.
//
// The [Ordered] type can be any of Go's [cmp.Ordered] (strings, numeric types),
// []byte (uses [bytes.Compare]) and [time.Time] (uses [time.Time.Compare].
//
// Notice that pointers are not [Ordered], but uintptr are. So you can't call [GreaterOrEqualT] with [*time.Time].
//
// [GreaterOrEqualT] ensures type safety at build time. If you need to compare values with a dynamically assigned type,
// use [GreaterOrEqual] instead.
//
// To compare values that need a type conversion (e.g. float32 against float64), you need to convert types beforehand.
//
// # Usage
//
//	assertions.GreaterOrEqualT(t, 2, 1)
//	assertions.GreaterOrEqualT(t, 2, 2)
//	assertions.GreaterOrEqualT(t, "b", "a")
//	assertions.GreaterOrEqualT(t, "b", "b")
//
// # Examples
//
//	success: 2, 1
//	failure: 1, 2
//
// Upon failure, the test [T] is marked as failed and continues execution.
func GreaterOrEqualT[Orderable Ordered](t T, e1 Orderable, e2 Orderable, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.GreaterOrEqualT[Orderable](t, e1, e2, msgAndArgs...)
}

// GreaterT asserts that for two elements of the same type,
// the first element is strictly greater than the second.
//
// The [Ordered] type can be any of Go's [cmp.Ordered] (strings, numeric types),
// []byte (uses [bytes.Compare]) and [time.Time] (uses [time.Time.Compare].
//
// Notice that pointers are not [Ordered], but uintptr are. So you can't call [GreaterT] with [*time.Time].
//
// [GreaterT] ensures type safety at build time. If you need to compare values with a dynamically assigned type, use [Greater] instead.
//
// To compare values that need a type conversion (e.g. float32 against float64), you need to convert types beforehand.
//
// # Usage
//
//	assertions.GreaterT(t, 2, 1)
//	assertions.GreaterT(t, float64(2), float64(1))
//	assertions.GreaterT(t, "b", "a")
//	assertions.GreaterT(t, time.Date(2026,1,1,0,0,0,0,nil), time.Now())
//
// # Examples
//
//	success: 2, 1
//	failure: 1, 2
//
// Upon failure, the test [T] is marked as failed and continues execution.
func GreaterT[Orderable Ordered](t T, e1 Orderable, e2 Orderable, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.GreaterT[Orderable](t, e1, e2, msgAndArgs...)
}

// HTTPBodyContains asserts that a specified handler returns a body that contains a string.
//
// Returns whether the assertion was successful (true) or not (false).
//
// # Usage
//
//	assertions.HTTPBodyContains(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky")
//
// # Examples
//
//	success: httpBody, "GET", "/", url.Values{"name": []string{"World"}}, "Hello, World!"
//	failure: httpBody, "GET", "/", url.Values{"name": []string{"Bob"}}, "Hello, World!"
//
// Upon failure, the test [T] is marked as failed and continues execution.
func HTTPBodyContains(t T, handler http.HandlerFunc, method string, url string, values url.Values, str any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.HTTPBodyContains(t, handler, method, url, values, str, msgAndArgs...)
}

// HTTPBodyNotContains asserts that a specified handler returns a
// body that does not contain a string.
//
// Returns whether the assertion was successful (true) or not (false).
//
// # Usage
//
//	assertions.HTTPBodyNotContains(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky")
//
// # Examples
//
//	success: httpBody, "GET", "/", url.Values{"name": []string{"World"}}, "Hello, Bob!"
//	failure: httpBody, "GET", "/", url.Values{"name": []string{"Bob"}}, "Hello, Bob!"
//
// Upon failure, the test [T] is marked as failed and continues execution.
func HTTPBodyNotContains(t T, handler http.HandlerFunc, method string, url string, values url.Values, str any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.HTTPBodyNotContains(t, handler, method, url, values, str, msgAndArgs...)
}

// HTTPError asserts that a specified handler returns an error status code.
//
// Returns whether the assertion was successful (true) or not (false).
//
// # Usage
//
//	assertions.HTTPError(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}}
//
// # Examples
//
//	success: httpError, "GET", "/", nil
//	failure: httpOK, "GET", "/", nil
//
// Upon failure, the test [T] is marked as failed and continues execution.
func HTTPError(t T, handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.HTTPError(t, handler, method, url, values, msgAndArgs...)
}

// HTTPRedirect asserts that a specified handler returns a redirect status code.
//
// Returns whether the assertion was successful (true) or not (false).
//
// # Usage
//
//	assertions.HTTPRedirect(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}}
//
// # Examples
//
//	success: httpRedirect, "GET", "/", nil
//	failure: httpError, "GET", "/", nil
//
// Upon failure, the test [T] is marked as failed and continues execution.
func HTTPRedirect(t T, handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.HTTPRedirect(t, handler, method, url, values, msgAndArgs...)
}

// HTTPStatusCode asserts that a specified handler returns a specified status code.
//
// Returns whether the assertion was successful (true) or not (false).
//
// # Usage
//
//	assertions.HTTPStatusCode(t, myHandler, "GET", "/notImplemented", nil, 501)
//
// # Examples
//
//	success: httpOK, "GET", "/", nil, http.StatusOK
//	failure: httpError, "GET", "/", nil, http.StatusOK
//
// Upon failure, the test [T] is marked as failed and continues execution.
func HTTPStatusCode(t T, handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.HTTPStatusCode(t, handler, method, url, values, statuscode, msgAndArgs...)
}

// HTTPSuccess asserts that a specified handler returns a success status code.
//
// Returns whether the assertion was successful (true) or not (false).
//
// # Usage
//
//	assertions.HTTPSuccess(t, myHandler, "POST", "http://www.google.com", nil)
//
// # Examples
//
//	success: httpOK, "GET", "/", nil
//	failure: httpError, "GET", "/", nil
//
// Upon failure, the test [T] is marked as failed and continues execution.
func HTTPSuccess(t T, handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.HTTPSuccess(t, handler, method, url, values, msgAndArgs...)
}

// Implements asserts that an object is implemented by the specified interface.
//
// # Usage
//
//	assertions.Implements(t, (*MyInterface)(nil), new(MyObject))
//
// # Examples
//
//	success: ptr(dummyInterface), new(testing.T)
//	failure: (*error)(nil), new(testing.T)
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Implements(t T, interfaceObject any, object any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.Implements(t, interfaceObject, object, msgAndArgs...)
}

// InDelta asserts that the two numerals are within delta of each other.
//
// Delta must be greater than or equal to zero.
//
// Expected and actual values should convert to float64.
// To compare large integers that can't be represented accurately as float64 (e.g. uint64),
// prefer [InDeltaT] to preserve the original type.
//
// # Behavior with IEEE floating point arithmetic
//
//   - expected NaN is matched only by a NaN, e.g. this works: [InDeltaT]([math.Sqrt](-1), [math.Sqrt](-1), 0.0)
//   - expected +Inf is matched only by a +Inf
//   - expected -Inf is matched only by a -Inf
//
// # Usage
//
//	assertions.InDelta(t, math.Pi, 22/7.0, 0.01)
//
// # Examples
//
//	success: 1.0, 1.01, 0.02
//	failure: 1.0, 1.1, 0.05
//
// Upon failure, the test [T] is marked as failed and continues execution.
func InDelta(t T, expected any, actual any, delta float64, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.InDelta(t, expected, actual, delta, msgAndArgs...)
}

// InDeltaMapValues is the same as [InDelta], but it compares all values between two maps. Both maps must have exactly the same keys.
//
// See [InDelta].
//
// # Usage
//
//	assertions.InDeltaMapValues(t, map[string]float64{"a": 1.0}, map[string]float64{"a": 1.01}, 0.02)
//
// # Examples
//
//	success: map[string]float64{"a": 1.0}, map[string]float64{"a": 1.01}, 0.02
//	failure: map[string]float64{"a": 1.0}, map[string]float64{"a": 1.1}, 0.05
//
// Upon failure, the test [T] is marked as failed and continues execution.
func InDeltaMapValues(t T, expected any, actual any, delta float64, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.InDeltaMapValues(t, expected, actual, delta, msgAndArgs...)
}

// InDeltaSlice is the same as [InDelta], except it compares two slices.
//
// It returns false if the compared slices are not of the same length.
//
// See [InDelta].
//
// # Usage
//
//	assertions.InDeltaSlice(t, []float64{1.0, 2.0}, []float64{1.01, 2.01}, 0.02)
//
// # Examples
//
//	success: []float64{1.0, 2.0}, []float64{1.01, 2.01}, 0.02
//	failure: []float64{1.0, 2.0}, []float64{1.1, 2.1}, 0.05
//
// Upon failure, the test [T] is marked as failed and continues execution.
func InDeltaSlice(t T, expected any, actual any, delta float64, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.InDeltaSlice(t, expected, actual, delta, msgAndArgs...)
}

// InDeltaT asserts that the two numerals of the same type numerical type are within delta of each other.
//
// [InDeltaT] accepts any go numeric type, including integer types.
//
// The main difference with [InDelta] is that the delta is expressed with the same type as the values, not necessarily a float64.
//
// Delta must be greater than or equal to zero.
//
// # Behavior with IEEE floating point arithmetic
//
//   - expected NaN is matched only by a NaN, e.g. this works: InDeltaT([math.NaN](), [math.Sqrt](-1), 0.0)
//   - expected +Inf is matched only by a +Inf
//   - expected -Inf is matched only by a -Inf
//
// # Usage
//
//	assertions.InDeltaT(t, math.Pi, 22/7.0, 0.01)
//
// # Examples
//
//	success: 1.0, 1.01, 0.02
//	failure: 1.0, 1.1, 0.05
//
// Upon failure, the test [T] is marked as failed and continues execution.
func InDeltaT[Number Measurable](t T, expected Number, actual Number, delta Number, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.InDeltaT[Number](t, expected, actual, delta, msgAndArgs...)
}

// InEpsilon asserts that expected and actual have a relative error less than epsilon.
//
// # Behavior with IEEE floating point arithmetic
//
//   - expected NaN is matched only by a NaN, e.g. this works: [InDeltaT]([math.NaN](), [math.Sqrt](-1), 0.0)
//   - expected +Inf is matched only by a +Inf
//   - expected -Inf is matched only by a -Inf
//
// Edge case: for very large integers that do not convert accurately to a float64 (e.g. uint64), prefer [InDeltaT].
//
// Formula:
//
//   - If expected == 0: fail if |actual - expected| > epsilon
//   - If expected != 0: fail if |actual - expected| > epsilon * |expected|
//
// This allows [InEpsilonT] to work naturally across the full numeric range including zero.
//
// # Usage
//
//	assertions.InEpsilon(t, 100.0, 101.0, 0.02)
//
// # Examples
//
//	success: 100.0, 101.0, 0.02
//	failure: 100.0, 110.0, 0.05
//
// Upon failure, the test [T] is marked as failed and continues execution.
func InEpsilon(t T, expected any, actual any, epsilon float64, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.InEpsilon(t, expected, actual, epsilon, msgAndArgs...)
}

// InEpsilonSlice is the same as [InEpsilon], except it compares each value from two slices.
//
// See [InEpsilon].
//
// # Usage
//
//	assertions.InEpsilonSlice(t, []float64{100.0, 200.0}, []float64{101.0, 202.0}, 0.02)
//
// # Examples
//
//	success: []float64{100.0, 200.0}, []float64{101.0, 202.0}, 0.02
//	failure: []float64{100.0, 200.0}, []float64{110.0, 220.0}, 0.05
//
// Upon failure, the test [T] is marked as failed and continues execution.
func InEpsilonSlice(t T, expected any, actual any, epsilon float64, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.InEpsilonSlice(t, expected, actual, epsilon, msgAndArgs...)
}

// InEpsilonSymmetric asserts that 2 numbers are close, with a symmetric relative error.
//
// Unlike with [InEpsilon], both numbers play a symmetric role and the relative error is
// computed relative to the number with greatest amplitude. This mirrors the behavior of
// Python's [math.isclose] (with the relative-tolerance term only).
//
// See also [InEpsilon].
//
// # Behavior with IEEE floating point arithmetic
//
//   - NaN is matched only by a NaN, e.g. this works: [InEpsilonSymmetric]([math.NaN](), [math.Sqrt](-1), 0.0)
//   - +Inf is matched only by a +Inf
//   - -Inf is matched only by a -Inf
//
// Edge case: for very large integers that do not convert accurately to a float64 (e.g. uint64), prefer [InDelta].
//
// Formula:
//
//   - If x == 0 and y == 0: success
//   - Otherwise fail if |x - y| > epsilon * max(|x|,|y|)
//
// # Usage
//
//	assertions.InEpsilonSymmetric(t, 100.0, 101.0, 0.02)
//
// # Examples
//
//	success: 100.0, 101.0, 0.02
//	failure: 100.0, 110.0, 0.05
//
// Upon failure, the test [T] is marked as failed and continues execution.
//
// [math.isclose]: https://docs.python.org/3/library/math.html#math.isclose
func InEpsilonSymmetric(t T, x any, y any, epsilon float64, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.InEpsilonSymmetric(t, x, y, epsilon, msgAndArgs...)
}

// InEpsilonSymmetricT is the type-safe version of [InEpsilonSymmetric], comparing numbers of the same numerical type.
//
// See [InEpsilonSymmetric].
//
// # Usage
//
//	assertions.InEpsilonSymmetricT(t, 100.0, 101.0, 0.02)
//
// # Examples
//
//	success: 100.0, 101.0, 0.02
//	failure: 100.0, 110.0, 0.05
//
// Upon failure, the test [T] is marked as failed and continues execution.
func InEpsilonSymmetricT[Number Measurable](t T, x Number, y Number, epsilon float64, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.InEpsilonSymmetricT[Number](t, x, y, epsilon, msgAndArgs...)
}

// InEpsilonT asserts that expected and actual have a relative error less than epsilon.
//
// When expected is zero, epsilon is interpreted as an absolute error threshold,
// since relative error is mathematically undefined for zero values.
//
// Unlike [InDeltaT], which preserves the original type, [InEpsilonT] converts the expected and actual
// numbers to float64, since the relative error doesn't make sense as an integer.
//
// # Behavior with IEEE floating point arithmetic
//
//   - expected NaN is matched only by a NaN, e.g. this works: [InDeltaT]([math.NaN](), [math.Sqrt](-1), 0.0)
//   - expected +Inf is matched only by a +Inf
//   - expected -Inf is matched only by a -Inf
//
// Edge case: for very large integers that do not convert accurately to a float64 (e.g. uint64), prefer [InDeltaT].
//
// Formula:
//
//   - If expected == 0: fail if |actual - expected| > epsilon
//   - If expected != 0: fail if |actual - expected| > epsilon * |expected|
//
// This allows [InEpsilonT] to work naturally across the full numeric range including zero.
//
// # Usage
//
//	assertions.InEpsilon(t, 100.0, 101.0, 0.02)
//
// # Examples
//
//	success: 100.0, 101.0, 0.02
//	failure: 100.0, 110.0, 0.05
//
// Upon failure, the test [T] is marked as failed and continues execution.
func InEpsilonT[Number Measurable](t T, expected Number, actual Number, epsilon float64, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.InEpsilonT[Number](t, expected, actual, epsilon, msgAndArgs...)
}

// IsDecreasing asserts that the collection is strictly decreasing.
//
// # Usage
//
//	assertions.IsDecreasing(t, []int{2, 1, 0})
//	assertions.IsDecreasing(t, []float{2, 1})
//	assertions.IsDecreasing(t, []string{"b", "a"})
//
// # Examples
//
//	success: []int{3, 2, 1}
//	failure: []int{1, 2, 3}
//
// Upon failure, the test [T] is marked as failed and continues execution.
func IsDecreasing(t T, collection any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.IsDecreasing(t, collection, msgAndArgs...)
}

// IsDecreasingT asserts that a slice of [Ordered] is strictly decreasing.
//
// # Usage
//
//	assertions.IsDecreasingT(t, []int{2, 1, 0})
//	assertions.IsDecreasingT(t, []float{2, 1})
//	assertions.IsDecreasingT(t, []string{"b", "a"})
//
// # Examples
//
//	success: []int{3, 2, 1}
//	failure: []int{1, 2, 3}
//
// Upon failure, the test [T] is marked as failed and continues execution.
func IsDecreasingT[OrderedSlice ~[]E, E Ordered](t T, collection OrderedSlice, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.IsDecreasingT[OrderedSlice, E](t, collection, msgAndArgs...)
}

// IsIncreasing asserts that the collection is strictly increasing.
//
// # Usage
//
//	assertions.IsIncreasing(t, []int{1, 2, 3})
//	assertions.IsIncreasing(t, []float{1, 2})
//	assertions.IsIncreasing(t, []string{"a", "b"})
//
// # Examples
//
//	success: []int{1, 2, 3}
//	failure: []int{1, 1, 2}
//
// Upon failure, the test [T] is marked as failed and continues execution.
func IsIncreasing(t T, collection any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.IsIncreasing(t, collection, msgAndArgs...)
}

// IsIncreasingT asserts that a slice of [Ordered] is strictly increasing.
//
// # Usage
//
//	assertions.IsIncreasingT(t, []int{1, 2, 3})
//	assertions.IsIncreasingT(t, []float{1, 2})
//	assertions.IsIncreasingT(t, []string{"a", "b"})
//
// # Examples
//
//	success: []int{1, 2, 3}
//	failure: []int{1, 1, 2}
//
// Upon failure, the test [T] is marked as failed and continues execution.
func IsIncreasingT[OrderedSlice ~[]E, E Ordered](t T, collection OrderedSlice, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.IsIncreasingT[OrderedSlice, E](t, collection, msgAndArgs...)
}

// IsNonDecreasing asserts that the collection is not strictly decreasing.
//
// This is the logical negation of [IsDecreasing]: it succeeds whenever
// [IsDecreasing] would fail, including for sequences that are neither
// increasing nor decreasing (e.g. [3, 1, 2]).
//
// It is NOT the same as "weakly increasing" (a[i] <= a[i+1] for all i).
//
// # Usage
//
//	assertions.IsNonDecreasing(t, []int{1, 1, 2})
//	assertions.IsNonDecreasing(t, []float{1, 2})
//	assertions.IsNonDecreasing(t, []string{"a", "b"})
//
// # Examples
//
//	success: []int{1, 1, 2}
//	failure: []int{2, 1, 0}
//
// Upon failure, the test [T] is marked as failed and continues execution.
func IsNonDecreasing(t T, collection any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.IsNonDecreasing(t, collection, msgAndArgs...)
}

// IsNonDecreasingT asserts that a slice of [Ordered] is NOT strictly decreasing.
//
// This is the logical negation of [IsDecreasingT]: it succeeds whenever
// [IsDecreasingT] would fail, including for sequences that are neither
// increasing nor decreasing (e.g. [3, 1, 2]).
//
// It is NOT the same as "weakly increasing" (a[i] <= a[i+1] for all i).
//
// # Usage
//
//	assertions.IsNonDecreasingT(t, []int{1, 1, 2})
//	assertions.IsNonDecreasingT(t, []float{1, 2})
//	assertions.IsNonDecreasingT(t, []string{"a", "b"})
//
// # Examples
//
//	success: []int{1, 1, 2}
//	failure: []int{2, 1, 0}
//
// Upon failure, the test [T] is marked as failed and continues execution.
func IsNonDecreasingT[OrderedSlice ~[]E, E Ordered](t T, collection OrderedSlice, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.IsNonDecreasingT[OrderedSlice, E](t, collection, msgAndArgs...)
}

// IsNonIncreasing asserts that the collection is not strictly increasing.
//
// This is the logical negation of [IsIncreasing]: it succeeds whenever
// [IsIncreasing] would fail, including for sequences that are neither
// increasing nor decreasing (e.g. [1, 3, 2]).
//
// It is NOT the same as "weakly decreasing" (a[i] >= a[i+1] for all i).
//
// # Usage
//
//	assertions.IsNonIncreasing(t, []int{2, 1, 1})
//	assertions.IsNonIncreasing(t, []float{2, 1})
//	assertions.IsNonIncreasing(t, []string{"b", "a"})
//
// # Examples
//
//	success: []int{2, 1, 1}
//	failure: []int{1, 2, 3}
//
// Upon failure, the test [T] is marked as failed and continues execution.
func IsNonIncreasing(t T, collection any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.IsNonIncreasing(t, collection, msgAndArgs...)
}

// IsNonIncreasingT asserts that a slice of [Ordered] is NOT strictly increasing.
//
// This is the logical negation of [IsIncreasingT]: it succeeds whenever
// [IsIncreasingT] would fail, including for sequences that are neither
// increasing nor decreasing (e.g. [1, 3, 2]).
//
// It is NOT the same as "weakly decreasing" (a[i] >= a[i+1] for all i).
//
// # Usage
//
//	assertions.IsNonIncreasingT(t, []int{2, 1, 1})
//	assertions.IsNonIncreasingT(t, []float{2, 1})
//	assertions.IsNonIncreasingT(t, []string{"b", "a"})
//
// # Examples
//
//	success: []int{2, 1, 1}
//	failure: []int{1, 2, 3}
//
// Upon failure, the test [T] is marked as failed and continues execution.
func IsNonIncreasingT[OrderedSlice ~[]E, E Ordered](t T, collection OrderedSlice, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.IsNonIncreasingT[OrderedSlice, E](t, collection, msgAndArgs...)
}

// IsNotOfTypeT asserts that an object is not of a given type.
//
// # Usage
//
//	assertions.IsOfType[MyType](t,myVar)
//
// # Examples
//
//	success: 123.123
//	failure: myType(123.123)
//
// Upon failure, the test [T] is marked as failed and continues execution.
func IsNotOfTypeT[EType any](t T, object any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.IsNotOfTypeT[EType](t, object, msgAndArgs...)
}

// IsNotType asserts that the specified objects are not of the same type.
//
// # Usage
//
//	assertions.IsNotType(t, &NotMyStruct{}, &MyStruct{})
//
// # Examples
//
//	success: int32(123), int64(456)
//	failure: 123, 456
//
// Upon failure, the test [T] is marked as failed and continues execution.
func IsNotType(t T, theType any, object any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.IsNotType(t, theType, object, msgAndArgs...)
}

// IsOfTypeT asserts that an object is of a given type.
//
// # Usage
//
//	assertions.IsOfTypeT[MyType](t,myVar)
//
// # Examples
//
//	success: myType(123.123)
//	failure: 123.123
//
// Upon failure, the test [T] is marked as failed and continues execution.
func IsOfTypeT[EType any](t T, object any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.IsOfTypeT[EType](t, object, msgAndArgs...)
}

// IsType asserts that the specified objects are of the same type.
//
// # Usage
//
//	assertions.IsType(t, &MyStruct{}, &MyStruct{})
//
// # Examples
//
//	success: 123, 456
//	failure: int32(123), int64(456)
//
// Upon failure, the test [T] is marked as failed and continues execution.
func IsType(t T, expectedType any, object any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.IsType(t, expectedType, object, msgAndArgs...)
}

// JSONEq asserts that two JSON strings are semantically equivalent.
//
// Expected and actual must be valid JSON.
//
// For dynamic redaction of the input text via a callback, use [JSONEqT].
//
// # Usage
//
//	assertions.JSONEq(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`)
//
// # Examples
//
//	success: `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`
//	failure: `{"hello": "world", "foo": "bar"}`, `[{"foo": "bar"}, {"hello": "world"}]`
//
// Upon failure, the test [T] is marked as failed and continues execution.
func JSONEq(t T, expected string, actual string, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.JSONEq(t, expected, actual, msgAndArgs...)
}

// JSONEqBytes asserts that two JSON slices of bytes are semantically equivalent.
//
// Expected and actual must be valid JSON.
//
// # Usage
//
//	assertions.JSONEqBytes(t, []byte(`{"hello": "world", "foo": "bar"}`), []byte(`{"foo": "bar", "hello": "world"}`))
//
// # Examples
//
//	success: []byte(`{"hello": "world", "foo": "bar"}`), []byte(`{"foo": "bar", "hello": "world"}`)
//	failure: []byte(`{"hello": "world", "foo": "bar"}`), []byte(`[{"foo": "bar"}, {"hello": "world"}]`)
//
// Upon failure, the test [T] is marked as failed and continues execution.
func JSONEqBytes(t T, expected []byte, actual []byte, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.JSONEqBytes(t, expected, actual, msgAndArgs...)
}

// JSONEqT asserts that two JSON documents are semantically equivalent.
//
// The expected and actual arguments may be string or []byte. They do not need to be of the same type.
//
// Expected and actual must be valid JSON.
//
// NOTE: passed values (expected, actual) may be wrapped as functions to redact the input text dynamically.
//
// # Usage
//
//	assertions.JSONEqT(t, `{"hello": "world", "foo": "bar"}`, []byte(`{"foo": "bar", "hello": "world"}`))
//
// # Examples
//
//	success: `{"hello": "world", "foo": "bar"}`, []byte(`{"foo": "bar", "hello": "world"}`)
//	failure: `{"hello": "world", "foo": "bar"}`, `[{"foo": "bar"}, {"hello": "world"}]`
//
// Upon failure, the test [T] is marked as failed and continues execution.
func JSONEqT[EDoc, ADoc RText](t T, expected EDoc, actual ADoc, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.JSONEqT[EDoc, ADoc](t, expected, actual, msgAndArgs...)
}

// JSONMarshalAsT wraps [JSONEqT] after [json.Marshal].
//
// The input JSON may be a string or []byte.
//
// It fails if the marshaling returns an error or if the expected JSON bytes differ semantically
// from the expected ones.
//
// NOTE: passed expected value may be wrapped as a function to redact the input text dynamically.
//
// # Usage
//
//	actual := struct {
//		A int `json:"a"`
//	}{
//		A: 10,
//	}
//
//	assertions.JSONUnmarshalAsT(t,expected, `{"a": 10}`)
//
// # Examples
//
//	success: []byte(`{"A": "a"}`), dummyStruct{A: "a"}
//	failure: `[{"foo": "bar"}, {"hello": "world"}]`, 1
//
// Upon failure, the test [T] is marked as failed and continues execution.
func JSONMarshalAsT[EDoc RText](t T, expected EDoc, object any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.JSONMarshalAsT[EDoc](t, expected, object, msgAndArgs...)
}

// JSONUnmarshalAsT wraps [Equal] after [json.Unmarshal].
//
// The input JSON may be a string or []byte.
//
// It fails if the unmarshaling returns an error or if the resulting object is not equal to the expected one.
//
// Be careful not to wrap the expected object into an "any" interface if this is not what you expected:
// the unmarshaling would take this type to unmarshal as a map[string]any.
//
// NOTE: passed jazon value may be wrapped as a function to redact the input JSON dynamically.
//
// # Usage
//
//	expected := struct {
//		A int `json:"a"`
//	}{
//		A: 10,
//	}
//
//	assertions.JSONUnmarshalAsT(t,expected, `{"a": 10}`)
//
// # Examples
//
//	success: dummyStruct{A: "a"} , []byte(`{"A": "a"}`)
//	failure: 1, `[{"foo": "bar"}, {"hello": "world"}]`
//
// Upon failure, the test [T] is marked as failed and continues execution.
func JSONUnmarshalAsT[Object any, ADoc RText](t T, expected Object, jazon ADoc, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.JSONUnmarshalAsT[Object, ADoc](t, expected, jazon, msgAndArgs...)
}

// Kind asserts that the [reflect.Kind] of a given object matches the expected [reflect.Kind].
//
// Kind reflects the concrete value stored in the object. The nil value (or interface with nil value)
// are comparable to [reflect.Invalid]. See also [reflect.Value.Kind].
//
// # Usage
//
//	assertions.Kind(t, reflect.String, "Hello World")
//
// # Examples
//
//	success: reflect.String, "hello"
//	failure: reflect.String, 0
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Kind(t T, expectedKind reflect.Kind, object any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.Kind(t, expectedKind, object, msgAndArgs...)
}

// Len asserts that the specified object has specific length.
//
// Len also fails if the object has a type that len() does not accept.
//
// The asserted object can be a string, a slice, a map, an array, pointer to array or a channel.
//
// # Usage
//
//	assertions.Len(t, mySlice, 3)
//	assertions.Len(t, myString, 4)
//	assertions.Len(t, myMap, 5)
//
// # Examples
//
//	success: []string{"A","B"}, 2
//	failure: []string{"A","B"}, 1
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Len(t T, object any, length int, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.Len(t, object, length, msgAndArgs...)
}

// Less asserts that the first element is strictly less than the second.
//
// Both elements must be of the same type in the [reflect.Kind] sense.
// To compare values that need a type conversion (e.g. float32 against float64), you need to convert types beforehand.
//
// # Usage
//
//	assertions.Less(t, 1, 2)
//	assertions.Less(t, float64(1), float64(2))
//	assertions.Less(t, "a", "b")
//
// # Examples
//
//	success: 1, 2
//	failure: 2, 1
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Less(t T, e1 any, e2 any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.Less(t, e1, e2, msgAndArgs...)
}

// LessOrEqual asserts that the first element is less than or equal to the second.
//
// # Usage
//
//	assertions.LessOrEqual(t, 1, 2)
//	assertions.LessOrEqual(t, 2, 2)
//	assertions.LessOrEqual(t, "a", "b")
//	assertions.LessOrEqual(t, "b", "b")
//
// # Examples
//
//	success: 1, 2
//	failure: 2, 1
//
// Upon failure, the test [T] is marked as failed and continues execution.
func LessOrEqual(t T, e1 any, e2 any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.LessOrEqual(t, e1, e2, msgAndArgs...)
}

// LessOrEqualT asserts that for two elements of the same type, the first element is less than or equal to the second.
//
// The [Ordered] type can be any of Go's [cmp.Ordered] (strings, numeric types),
// []byte (uses [bytes.Compare]) and [time.Time] (uses [time.Time.Compare].
//
// Notice that pointers are not [Ordered], but uintptr are. So you can't call [LessOrEqualT] with [*time.Time].
//
// [LessOrEqualT] ensures type safety at build time. If you need to compare values with a dynamically assigned type,
// use [LessOrEqual] instead.
//
// To compare values that need a type conversion (e.g. float32 against float64), you should use [LessOrEqual] instead.
//
// # Usage
//
//	assertions.LessOrEqualT(t, 1, 2)
//	assertions.LessOrEqualT(t, 2, 2)
//	assertions.LessOrEqualT(t, "a", "b")
//	assertions.LessOrEqualT(t, "b", "b")
//
// # Examples
//
//	success: 1, 2
//	failure: 2, 1
//
// Upon failure, the test [T] is marked as failed and continues execution.
func LessOrEqualT[Orderable Ordered](t T, e1 Orderable, e2 Orderable, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.LessOrEqualT[Orderable](t, e1, e2, msgAndArgs...)
}

// LessT asserts that for two elements of the same type, the first element is strictly less than the second.
//
// The [Ordered] type can be any of Go's [cmp.Ordered] (strings, numeric types),
// []byte (uses [bytes.Compare]) and [time.Time] (uses [time.Time.Compare].
//
// Notice that pointers are not [Ordered], but uintptr are. So you can't call [LessT] with [*time.Time].
//
// [LessT] ensures type safety at build time. If you need to compare values with a dynamically assigned type,
// use [Less] instead.
//
// To compare values that need a type conversion (e.g. float32 against float64), you need to convert types beforehand.
//
// # Usage
//
//	assertions.LessT(t, 1, 2)
//	assertions.LessT(t, float64(1), float64(2))
//	assertions.LessT(t, "a", "b")
//
// # Examples
//
//	success: 1, 2
//	failure: 2, 1
//
// Upon failure, the test [T] is marked as failed and continues execution.
func LessT[Orderable Ordered](t T, e1 Orderable, e2 Orderable, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.LessT[Orderable](t, e1, e2, msgAndArgs...)
}

// MapContainsT asserts that the specified map contains a key.
//
// Go native comparable types are explained there: [comparable-types].
//
// # Usage
//
//	assertions.MapContainsT(t, map[string]string{"Hello": "x","World": "y"}, "World")
//
// # Examples
//
//	success: map[string]string{"A": "B"}, "A"
//	failure: map[string]string{"A": "B"}, "C"
//
// Upon failure, the test [T] is marked as failed and continues execution.
//
// [comparable-types]: https://go.dev/blog/comparable
func MapContainsT[Map ~map[K]V, K comparable, V any](t T, m Map, key K, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.MapContainsT[Map, K, V](t, m, key, msgAndArgs...)
}

// MapEqualT asserts that 2 maps of comparable elements are equal,
// that is have the same length and contain the keys with the same elements.
//
// See also [maps.Equal].
//
// # Usage
//
//	assertions.MapEqualT(t, map[string]string{"1": "Hello", "2": "World"}, map[string]string{"1": "Hello", "2": "World"})
//
// # Examples
//
//	success: map[string]string{"1": "Hello", "2": "World"}, map[string]string{"1": "Hello", "2": "World"}
//	failure: map[string]string{"2": "Hello", "1": "World"}, map[string]string{"1": "Hello", "2": "World"}
//
// Upon failure, the test [T] is marked as failed and continues execution.
//
// [comparable-types]: https://go.dev/blog/comparable
func MapEqualT[K, V comparable](t T, listA map[K]V, listB map[K]V, msgAndArgs ...any) (ok bool) {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.MapEqualT[K, V](t, listA, listB, msgAndArgs...)
}

// MapNotContainsT asserts that the specified map does not contain a key.
//
// # Usage
//
//	assertions.MapNotContainsT(t, map[string]string{"Hello": "x","World": "y"}, "hi")
//
// # Examples
//
//	success: map[string]string{"A": "B"}, "C"
//	failure: map[string]string{"A": "B"}, "A"
//
// Upon failure, the test [T] is marked as failed and continues execution.
func MapNotContainsT[Map ~map[K]V, K comparable, V any](t T, m Map, key K, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.MapNotContainsT[Map, K, V](t, m, key, msgAndArgs...)
}

// MapNotEqualT asserts that 2 maps of comparable elements are not equal.
//
// See also [MapEqualT].
//
// # Usage
//
//	assertions.MapNotEqualT(t, map[string]string{"2": "Hello", "1": "World"}, map[string]string{"1": "Hello", "2": "World"})
//
// # Examples
//
//	success: map[string]string{"2": "Hello", "1": "World"}, map[string]string{"1": "Hello", "2": "World"}
//	failure: map[string]string{"1": "Hello", "2": "World"}, map[string]string{"1": "Hello", "2": "World"}
//
// Upon failure, the test [T] is marked as failed and continues execution.
//
// [comparable-types]: https://go.dev/blog/comparable
func MapNotEqualT[K, V comparable](t T, listA map[K]V, listB map[K]V, msgAndArgs ...any) (ok bool) {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.MapNotEqualT[K, V](t, listA, listB, msgAndArgs...)
}

// Negative asserts that the specified element is strictly negative.
//
// # Usage
//
//	assertions.Negative(t, -1)
//	assertions.Negative(t, -1.23)
//
// # Examples
//
//	success: -1
//	failure: 1
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Negative(t T, e any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.Negative(t, e, msgAndArgs...)
}

// NegativeT asserts that the specified element of a signed numeric type is strictly negative.
//
// # Usage
//
//	assertions.NegativeT(t, -1)
//	assertions.NegativeT(t, -1.23)
//
// # Examples
//
//	success: -1
//	failure: 1
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NegativeT[SignedNumber SignedNumeric](t T, e SignedNumber, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.NegativeT[SignedNumber](t, e, msgAndArgs...)
}

// Never asserts that the given condition is never satisfied until timeout,
// periodically checking the target function at each tick.
//
// [Never] is the opposite of [Eventually] ("at least once").
// It succeeds if the timeout is reached without the condition ever returning true.
//
// If the parent context is cancelled before the timeout, [Never] fails.
//
// # Usage
//
//	assertions.Never(t, func() bool { return false }, time.Second, 10*time.Millisecond)
//
// See also [Eventually] for details about using context, concurrency, and panic recovery.
//
// # Alternative condition signature
//
// The simplest form of condition is:
//
//	func() bool
//
// Use [Consistently] instead if you want to use a condition returning an error.
//
// # Panic recovery
//
// A panicking condition is treated as an error, causing [Never] to fail immediately.
// See [Eventually] for details.
//
// # Concurrency
//
// See [Eventually].
//
// # Attention point
//
// See [Eventually].
//
// # Synctest (opt-in)
//
// Wrap the condition with [WithSynctest] to run the polling loop inside a
// [testing/synctest] bubble, which uses a fake clock. This eliminates
// timing-induced flakiness and makes the tick count deterministic. See
// [WithSynctest] for the constraints (no real I/O in the condition,
// requires [*testing.T]). Note: [Never] does not accept the context/error
// form of condition, so [WithSynctestContext] does not apply here.
//
// # Examples
//
//	success:  func() bool { return false }, 100*time.Millisecond, 20*time.Millisecond
//	failure:  func() bool { return true }, 100*time.Millisecond, 20*time.Millisecond
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Never[C NeverConditioner](t T, condition C, timeout time.Duration, tick time.Duration, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.Never[C](t, condition, timeout, tick, msgAndArgs...)
}

// Nil asserts that the specified object is nil.
//
// # Usage
//
//	assertions.Nil(t, err)
//
// # Examples
//
//	success: nil
//	failure: "not nil"
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Nil(t T, object any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.Nil(t, object, msgAndArgs...)
}

// NoError asserts that a function returned a nil error (i.e. no error).
//
// # Usage
//
//	actualObj, err := SomeFunction()
//	if assert.NoError(t, err) {
//		assertions.Equal(t, expectedObj, actualObj)
//	}
//
// # Examples
//
//	success: nil
//	failure: ErrTest
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NoError(t T, err error, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.NoError(t, err, msgAndArgs...)
}

// NoFileDescriptorLeak ensures that no file descriptor leaks from inside the tested function.
//
// This assertion works on Linux (via /proc/self/fd) and macOS (via fstat probing).
// On other platforms, the test is skipped.
//
// NOTE: this assertion is not compatible with parallel tests.
// File descriptors are a process-wide resource; concurrent tests
// opening files would cause false positives.
//
// Sockets, pipes, and other kernel-internal descriptors (Linux anon_inode,
// darwin kqueue) are filtered out by default, as these are typically
// managed by the Go runtime.
//
// # Concurrency
//
// [NoFileDescriptorLeak] is not compatible with parallel tests.
// File descriptors are a process-wide resource; any concurrent I/O
// from other goroutines may cause false positives.
//
// Calls to [NoFileDescriptorLeak] are serialized with a mutex
// to prevent multiple leak checks from interfering with each other.
//
// # Usage
//
//	NoFileDescriptorLeak(t, func() {
//		// code that should not leak file descriptors
//	})
//
// # Examples
//
//	success: func() {}
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NoFileDescriptorLeak(t T, tested func(), msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.NoFileDescriptorLeak(t, tested, msgAndArgs...)
}

// NoGoRoutineLeak ensures that no goroutine did leak from inside the tested function.
//
// NOTE: only the go routines spawned from inside the tested function are checked for leaks.
// No filter or configuration is needed to exclude "known go routines".
//
// Resource cleanup should be done inside the tested function, and not using [testing.T.Cleanup],
// as t.Cleanup is called after the leak check.
//
// # Edge cases
//
//   - if the tested function panics leaving behind leaked goroutines, these are detected.
//   - if the tested function calls [runtime.Goexit] (e.g. from [testing.T.FailNow]) leaving behind leaked goroutines,
//     these are detected.
//   - if a panic occurs in one of the leaked go routines, it cannot be recovered with certainty and
//     the calling program will usually panic.
//
// # Concurrency
//
// [NoGoRoutineLeak] may be used safely in parallel tests.
//
// # Usage
//
//	NoGoRoutineLeak(t, func() {
//		...
//	},
//	"should not leak any go routine",
//	)
//
// # Examples
//
//	success: func() {}
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NoGoRoutineLeak(t T, tested func(), msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.NoGoRoutineLeak(t, tested, msgAndArgs...)
}

// NotBlocked asserts that a channel is not blocked on receive.
//
// It always fails if the operand is not a channel, or if the channel is send-only.
//
// A closed channel doesn't block and returns true.
// Notice that this consumes any message available in the channel.
//
// # Usage
//
//	ch := make(chan struct{}, 1)
//	ch <- struct{}{}
//	assertions.NotBlocked(t, ch)
//
// # Examples
//
//	success:  sendChanMessage()
//	failure:  make(chan struct{})
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotBlocked(t T, ch any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.NotBlocked(t, ch, msgAndArgs...)
}

// NotBlockedT asserts that a channel is not blocked on receive.
//
// A closed channel doesn't block and returns true.
// Notice that this consumes any message available in the channel.
//
// # Usage
//
//	ch := make(chan struct{}, 1)
//	ch <- struct{}{}
//	assertions.NotBlockedT(t, ch)
//
// # Examples
//
//	success:  sendChanMessage()
//	failure:  make(chan struct{})
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotBlockedT[E any, CHAN ~chan E](t T, ch CHAN, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.NotBlockedT[E, CHAN](t, ch, msgAndArgs...)
}

// NotContains asserts that the specified string, list(array, slice...) or map does NOT contain the
// specified substring or element.
//
// # Usage
//
//	assertions.NotContains(t, "Hello World", "Earth")
//	assertions.NotContains(t, ["Hello", "World"], "Earth")
//	assertions.NotContains(t, {"Hello": "World"}, "Earth")
//
// # Examples
//
//	success: []string{"A","B"}, "C"
//	failure: []string{"A","B"}, "B"
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotContains(t T, s any, contains any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.NotContains(t, s, contains, msgAndArgs...)
}

// NotElementsMatch asserts that the specified listA(array, slice...) is NOT equal to specified
// listB(array, slice...) ignoring the order of the elements. If there are duplicate elements,
// the number of appearances of each of them in both lists should not match.
// This is an inverse of [ElementsMatch].
//
// # Usage
//
//	assertions.NotElementsMatch(t, []int{1, 1, 2, 3}, []int{1, 1, 2, 3}) -> false
//	assertions.NotElementsMatch(t, []int{1, 1, 2, 3}, []int{1, 2, 3}) -> true
//	assertions.NotElementsMatch(t, []int{1, 2, 3}, []int{1, 2, 4}) -> true
//
// # Examples
//
//	success: []int{1, 2, 3}, []int{1, 2, 4}
//	failure: []int{1, 3, 2, 3}, []int{1, 3, 3, 2}
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotElementsMatch(t T, listA any, listB any, msgAndArgs ...any) (ok bool) {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.NotElementsMatch(t, listA, listB, msgAndArgs...)
}

// NotElementsMatchT asserts that the specified listA(array, slice...) is NOT equal to specified
// listB(array, slice...) ignoring the order of the elements. If there are duplicate elements,
// the number of appearances of each of them in both lists should not match.
// This is an inverse of [ElementsMatch].
//
// # Usage
//
//	assertions.NotElementsMatchT(t, []int{1, 1, 2, 3}, []int{1, 1, 2, 3}) -> false
//	assertions.NotElementsMatchT(t, []int{1, 1, 2, 3}, []int{1, 2, 3}) -> true
//	assertions.NotElementsMatchT(t, []int{1, 2, 3}, []int{1, 2, 4}) -> true
//
// # Examples
//
//	success: []int{1, 2, 3}, []int{1, 2, 4}
//	failure: []int{1, 3, 2, 3}, []int{1, 3, 3, 2}
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotElementsMatchT[E comparable](t T, listA []E, listB []E, msgAndArgs ...any) (ok bool) {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.NotElementsMatchT[E](t, listA, listB, msgAndArgs...)
}

// NotEmpty asserts that the specified object is NOT [Empty].
//
// # Usage
//
//	if assert.NotEmpty(t, obj) {
//		assertions.Equal(t, "two", obj[1])
//	}
//
// # Examples
//
//	success: "not empty"
//	failure: ""
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotEmpty(t T, object any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.NotEmpty(t, object, msgAndArgs...)
}

// NotEqual asserts that the specified values are NOT equal.
//
// # Usage
//
//	assertions.NotEqual(t, obj1, obj2)
//
// Pointer variable equality is determined based on the equality of the
// referenced values (as opposed to the memory addresses).
//
// Function equality cannot be determined and will always fail.
//
// # Examples
//
//	success: 123, 456
//	failure: 123, 123
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotEqual(t T, expected any, actual any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.NotEqual(t, expected, actual, msgAndArgs...)
}

// NotEqualT asserts that the specified values of the same comparable type are NOT equal.
//
// See [EqualT].
//
// # Usage
//
//	assertions.NotEqualT(t, obj1, obj2)
//
// # Examples
//
//	success: 123, 456
//	failure: 123, 123
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotEqualT[V comparable](t T, expected V, actual V, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.NotEqualT[V](t, expected, actual, msgAndArgs...)
}

// NotEqualValues asserts that two objects are not equal even when converted to the same type.
//
// Function equality cannot be determined and will always fail.
//
// # Usage
//
//	assertions.NotEqualValues(t, obj1, obj2)
//
// # Examples
//
//	success: uint32(123), int32(456)
//	failure: uint32(123), int32(123)
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotEqualValues(t T, expected any, actual any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.NotEqualValues(t, expected, actual, msgAndArgs...)
}

// NotErrorAs asserts that none of the errors in err's chain matches target,
// but if so, sets target to that error value.
//
// # Usage
//
//	assertions.NotErrorAs(t, err, &target)
//
// # Examples
//
//	success: ErrTest, new(*dummyError)
//	failure: fmt.Errorf("wrap: %w", &dummyError{}), new(*dummyError)
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotErrorAs(t T, err error, target any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.NotErrorAs(t, err, target, msgAndArgs...)
}

// NotErrorAsType asserts that none of the errors in err's chain is of type E.
//
// It is the type-safe counterpart of [NotErrorAs], built on the go1.26 [errors.AsType].
//
// target is only used to infer the type parameter E and is never assigned; it may be nil,
// in which case E must be supplied explicitly.
//
// This assertion requires go1.26 or newer; it is unavailable on older toolchains.
//
// # Usage
//
//	var target *MyError
//	assertions.NotErrorAsType(t, err, &target)
//
//	// or, supplying E explicitly:
//	assertions.NotErrorAsType[*MyError](t, err, nil)
//
// # Examples
//
//	success: ErrTest, new(*dummyError)
//	failure: fmt.Errorf("wrap: %w", &dummyError{}), new(*dummyError)
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotErrorAsType[E error](t T, err error, target *E, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.NotErrorAsType[E](t, err, target, msgAndArgs...)
}

// NotErrorIs asserts that none of the errors in err's chain matches target.
//
// This is a wrapper for [errors.Is].
//
// # Usage
//
//	assertions.NotErrorIs(t, err, io.EOF)
//
// # Examples
//
//	success: ErrTest, io.EOF
//	failure: fmt.Errorf("wrap: %w", io.EOF), io.EOF
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotErrorIs(t T, err error, target error, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.NotErrorIs(t, err, target, msgAndArgs...)
}

// NotImplements asserts that an object does not implement the specified interface.
//
// # Usage
//
//	assertions.NotImplements(t, (*MyInterface)(nil), new(MyObject))
//
// # Examples
//
//	success: (*error)(nil), new(testing.T)
//	failure: ptr(dummyInterface), new(testing.T)
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotImplements(t T, interfaceObject any, object any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.NotImplements(t, interfaceObject, object, msgAndArgs...)
}

// NotKind asserts that the [reflect.Kind] of a given object does not match the expected [reflect.Kind].
//
// Kind reflects the concrete value stored in the object. The nil value (or interface with nil value)
// are comparable to [reflect.Invalid]. See also [reflect.Value.Kind].
//
// # Usage
//
//	assertions.NotKind(t, reflect.Int, "Hello World")
//
// # Examples
//
//	success: reflect.String, 0
//	failure: reflect.String, "hello"
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotKind(t T, expectedKind reflect.Kind, object any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.NotKind(t, expectedKind, object, msgAndArgs...)
}

// NotNil asserts that the specified object is not nil.
//
// # Usage
//
//	assertions.NotNil(t, err)
//
// # Examples
//
//	success: "not nil"
//	failure: nil
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotNil(t T, object any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.NotNil(t, object, msgAndArgs...)
}

// NotPanics asserts that the code inside the specified function does NOT panic.
//
// # Usage
//
//	assertions.NotPanics(t, func(){ RemainCalm() })
//
// # Examples
//
//	success: func() { }
//	failure: func() { panic("panicking") }
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotPanics(t T, f func(), msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.NotPanics(t, f, msgAndArgs...)
}

// NotRegexp asserts that a specified regular expression does not match a string.
//
// See [Regexp].
//
// # Usage
//
//	assertions.NotRegexp(t, regexp.MustCompile("starts"), "it's starting")
//	assertions.NotRegexp(t, "^start", "it's not starting")
//
// # Examples
//
//	success: "^start", "not starting"
//	failure: "^start", "starting"
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotRegexp(t T, rx any, actual any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.NotRegexp(t, rx, actual, msgAndArgs...)
}

// NotRegexpT asserts that a specified regular expression does not match a string.
//
// See [RegexpT].
//
// # Usage
//
//	assertions.NotRegexp(t, regexp.MustCompile("starts"), "it's starting")
//	assertions.NotRegexp(t, "^start", "it's not starting")
//
// # Examples
//
//	success: "^start", "not starting"
//	failure: "^start", "starting"
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotRegexpT[Rex RegExp, ADoc Text](t T, rx Rex, actual ADoc, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.NotRegexpT[Rex, ADoc](t, rx, actual, msgAndArgs...)
}

// NotSame asserts that two pointers do not reference the same object.
//
// See [Same].
//
// # Usage
//
//	assertions.NotSame(t, ptr1, ptr2)
//
// # Examples
//
//	success: &staticVar, ptr("static string")
//	failure: &staticVar, staticVarPtr
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotSame(t T, expected any, actual any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.NotSame(t, expected, actual, msgAndArgs...)
}

// NotSameT asserts that two pointers do not reference the same object.
//
// See [SameT].
//
// # Usage
//
//	assertions.NotSameT(t, ptr1, ptr2)
//
// # Examples
//
//	success: &staticVar, ptr("static string")
//	failure: &staticVar, staticVarPtr
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotSameT[P any](t T, expected *P, actual *P, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.NotSameT[P](t, expected, actual, msgAndArgs...)
}

// NotSortedT asserts that the slice of [Ordered] is NOT sorted (i.e. non-strictly increasing).
//
// Unlike [IsDecreasingT], it accepts slices that are neither increasing nor decreasing.
//
// # Usage
//
//	assertions.NotSortedT(t, []int{3, 2, 3})
//	assertions.NotSortedT(t, []float{2, 1})
//	assertions.NotSortedT(t, []string{"b", "a"})
//
// # Examples
//
//	success: []int{3, 1, 3}
//	failure: []int{1, 4, 8}
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotSortedT[OrderedSlice ~[]E, E Ordered](t T, collection OrderedSlice, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.NotSortedT[OrderedSlice, E](t, collection, msgAndArgs...)
}

// NotSubset asserts that the list (array, slice, or map) does NOT contain all
// elements given in the subset (array, slice, or map).
// Map elements are key-value pairs unless compared with an array or slice where
// only the map key is evaluated.
//
// # Usage
//
//	assertions.NotSubset(t, [1, 3, 4], [1, 2])
//	assertions.NotSubset(t, {"x": 1, "y": 2}, {"z": 3})
//	assertions.NotSubset(t, [1, 3, 4], {1: "one", 2: "two"})
//	assertions.NotSubset(t, {"x": 1, "y": 2}, ["z"])
//
// # Examples
//
//	success: []int{1, 2, 3}, []int{4, 5}
//	failure: []int{1, 2, 3}, []int{1, 2}
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotSubset(t T, list any, subset any, msgAndArgs ...any) (ok bool) {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.NotSubset(t, list, subset, msgAndArgs...)
}

// NotZero asserts that i is not the zero value for its type.
//
// # Usage
//
//	assertions.NotZero(t, obj)
//
// # Examples
//
//	success: 1
//	failure: 0
//
// Upon failure, the test [T] is marked as failed and continues execution.
func NotZero(t T, i any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.NotZero(t, i, msgAndArgs...)
}

// Panics asserts that the code inside the specified function panics.
//
// # Usage
//
//	assertions.Panics(t, func(){ GoCrazy() })
//
// # Examples
//
//	success: func() { panic("panicking") }
//	failure: func() { }
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Panics(t T, f func(), msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.Panics(t, f, msgAndArgs...)
}

// PanicsWithError asserts that the code inside the specified function panics,
// and that the recovered panic value is an error that satisfies the [EqualError] comparison.
//
// # Usage
//
//	assertions.PanicsWithError(t, "crazy error", func(){ GoCrazy() })
//
// # Examples
//
//	success: ErrTest.Error(), func() { panic(ErrTest) }
//	failure: ErrTest.Error(), func() { }
//
// Upon failure, the test [T] is marked as failed and continues execution.
func PanicsWithError(t T, errString string, f func(), msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.PanicsWithError(t, errString, f, msgAndArgs...)
}

// PanicsWithValue asserts that the code inside the specified function panics,
// and that the recovered panic value equals the expected panic value.
//
// # Usage
//
//	assertions.PanicsWithValue(t, "crazy error", func(){ GoCrazy() })
//
// # Examples
//
//	success: "panicking", func() { panic("panicking") }
//	failure: "panicking", func() { }
//
// Upon failure, the test [T] is marked as failed and continues execution.
func PanicsWithValue(t T, expected any, f func(), msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.PanicsWithValue(t, expected, f, msgAndArgs...)
}

// Positive asserts that the specified element is strictly positive.
//
// # Usage
//
//	assertions.Positive(t, 1)
//	assertions.Positive(t, 1.23)
//
// # Examples
//
//	success: 1
//	failure: -1
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Positive(t T, e any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.Positive(t, e, msgAndArgs...)
}

// PositiveT asserts that the specified element of a signed numeric type is strictly positive.
//
// # Usage
//
//	assertions.PositiveT(t, 1)
//	assertions.PositiveT(t, 1.23)
//
// # Examples
//
//	success: 1
//	failure: -1
//
// Upon failure, the test [T] is marked as failed and continues execution.
func PositiveT[SignedNumber SignedNumeric](t T, e SignedNumber, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.PositiveT[SignedNumber](t, e, msgAndArgs...)
}

// Regexp asserts that a specified regular expression matches a string.
//
// The regular expression may be passed as a [regexp.Regexp], a string or a []byte and will be compiled.
//
// The actual argument to be matched may be a string, []byte or anything that prints as a string with [fmt.Sprint].
//
// # Usage
//
//	assertions.Regexp(t, regexp.MustCompile("start"), "it's starting")
//	assertions.Regexp(t, "start...$", "it's not starting")
//
// # Examples
//
//	success: "^start", "starting"
//	failure: "^start", "not starting"
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Regexp(t T, rx any, actual any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.Regexp(t, rx, actual, msgAndArgs...)
}

// RegexpT asserts that a specified regular expression matches a string.
//
// The actual argument to be matched may be a string or []byte.
//
// See [Regexp].
//
// # Examples
//
//	success: "^start", "starting"
//	failure: "^start", "not starting"
//
// Upon failure, the test [T] is marked as failed and continues execution.
func RegexpT[Rex RegExp, ADoc Text](t T, rx Rex, actual ADoc, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.RegexpT[Rex, ADoc](t, rx, actual, msgAndArgs...)
}

// Same asserts that two pointers reference the same object.
//
// Both arguments must be pointer variables.
//
// Pointer variable sameness is determined based on the equality of both type and value.
//
// Unlike [Equal] pointers, [Same] pointers point to the same memory address.
//
// # Usage
//
//	assertions.Same(t, ptr1, ptr2)
//
// # Examples
//
//	success: &staticVar, staticVarPtr
//	failure: &staticVar, ptr("static string")
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Same(t T, expected any, actual any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.Same(t, expected, actual, msgAndArgs...)
}

// SameT asserts that two pointers of the same type reference the same object.
//
// See [Same].
//
// # Usage
//
//	assertions.SameT(t, ptr1, ptr2)
//
// # Examples
//
//	success: &staticVar, staticVarPtr
//	failure: &staticVar, ptr("static string")
//
// Upon failure, the test [T] is marked as failed and continues execution.
func SameT[P any](t T, expected *P, actual *P, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.SameT[P](t, expected, actual, msgAndArgs...)
}

// SeqContainsT asserts that the specified iterator contains a comparable element.
//
// The sequence may not be consumed entirely: the iteration stops as soon as the specified element is found.
//
// Go native comparable types are explained there: [comparable-types].
//
// # Usage
//
//	assertions.SeqContainsT(t, slices.Values([]{"Hello","World"}), "World")
//
// # Examples
//
//	success: slices.Values([]string{"A","B"}), "A"
//	failure: slices.Values([]string{"A","B"}), "C"
//
// Upon failure, the test [T] is marked as failed and continues execution.
//
// [comparable-types]: https://go.dev/blog/comparable
func SeqContainsT[E comparable](t T, iter iter.Seq[E], element E, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.SeqContainsT[E](t, iter, element, msgAndArgs...)
}

// SeqNotContainsT asserts that the specified iterator does not contain a comparable element.
//
// See [SeqContainsT].
//
// # Usage
//
//	assertions.SeqContainsT(t, slices.Values([]{"Hello","World"}), "World")
//
// # Examples
//
//	success: slices.Values([]string{"A","B"}), "C"
//	failure: slices.Values([]string{"A","B"}), "A"
//
// Upon failure, the test [T] is marked as failed and continues execution.
func SeqNotContainsT[E comparable](t T, iter iter.Seq[E], element E, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.SeqNotContainsT[E](t, iter, element, msgAndArgs...)
}

// SliceContainsT asserts that the specified slice contains a comparable element.
//
// Go native comparable types are explained there: [comparable-types].
//
// # Usage
//
//	assertions.SliceContainsT(t, []{"Hello","World"}, "World")
//
// # Examples
//
//	success: []string{"A","B"}, "A"
//	failure: []string{"A","B"}, "C"
//
// Upon failure, the test [T] is marked as failed and continues execution.
//
// [comparable-types]: https://go.dev/blog/comparable
func SliceContainsT[Slice ~[]E, E comparable](t T, s Slice, element E, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.SliceContainsT[Slice, E](t, s, element, msgAndArgs...)
}

// SliceEqualT asserts that 2 slices of comparable elements are equal,
// that is have the same length and contain the same elements in the same order.
//
// See also [slices.Equal].
//
// # Usage
//
//	assertions.SliceEqualT(t, []string{"Hello","World"}, []string{"Hello","World"})
//
// # Examples
//
//	success: []string{"Hello","World"}, []string{"Hello","World"}
//	failure: []string{"Hello","World"}, []string{"Hello"}
//
// Upon failure, the test [T] is marked as failed and continues execution.
//
// [comparable-types]: https://go.dev/blog/comparable
func SliceEqualT[E comparable](t T, listA []E, listB []E, msgAndArgs ...any) (ok bool) {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.SliceEqualT[E](t, listA, listB, msgAndArgs...)
}

// SliceNotContainsT asserts that the specified slice does not contain a comparable element.
//
// See [SliceContainsT].
//
// # Usage
//
//	assertions.SliceNotContainsT(t, []{"Hello","World"}, "hi")
//
// # Examples
//
//	success: []string{"A","B"}, "C"
//	failure: []string{"A","B"}, "A"
//
// Upon failure, the test [T] is marked as failed and continues execution.
func SliceNotContainsT[Slice ~[]E, E comparable](t T, s Slice, element E, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.SliceNotContainsT[Slice, E](t, s, element, msgAndArgs...)
}

// SliceNotEqualT asserts that 2 slices of comparable elements are not equal.
//
// See also [SliceEqualT].
//
// # Usage
//
//	assertions.SliceNotEqualT(t, []string{"Hello","World"}, []string{"Hello"})
//
// # Examples
//
//	success: []string{"Hello","World"}, []string{"Hello"}
//	failure: []string{"Hello","World"}, []string{"Hello","World"}
//
// Upon failure, the test [T] is marked as failed and continues execution.
//
// [comparable-types]: https://go.dev/blog/comparable
func SliceNotEqualT[E comparable](t T, listA []E, listB []E, msgAndArgs ...any) (ok bool) {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.SliceNotEqualT[E](t, listA, listB, msgAndArgs...)
}

// SliceNotSubsetT asserts that a slice of comparable elements does not contain all the elements given in the subset.
//
// # Usage
//
//	assertions.SliceNotSubsetT(t, []int{1, 2, 3}, []int{1, 4})
//
// # Examples
//
//	success: []int{1, 2, 3}, []int{4, 5}
//	failure: []int{1, 2, 3}, []int{1, 2}
//
// Upon failure, the test [T] is marked as failed and continues execution.
func SliceNotSubsetT[Slice ~[]E, E comparable](t T, list Slice, subset Slice, msgAndArgs ...any) (ok bool) {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.SliceNotSubsetT[Slice, E](t, list, subset, msgAndArgs...)
}

// SliceSubsetT asserts that a slice of comparable elements contains all the elements given in the subset.
//
// # Usage
//
//	assertions.SliceSubsetT(t, []int{1, 2, 3}, []int{1, 2})
//
// # Examples
//
//	success: []int{1, 2, 3}, []int{1, 2}
//	failure: []int{1, 2, 3}, []int{4, 5}
//
// Upon failure, the test [T] is marked as failed and continues execution.
func SliceSubsetT[Slice ~[]E, E comparable](t T, list Slice, subset Slice, msgAndArgs ...any) (ok bool) {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.SliceSubsetT[Slice, E](t, list, subset, msgAndArgs...)
}

// SortedT asserts that the slice of [Ordered] is sorted (i.e. non-strictly increasing).
//
// Unlike [IsIncreasingT], it accepts elements to be equal.
//
// # Usage
//
//	assertions.SortedT(t, []int{1, 2, 3})
//	assertions.SortedT(t, []float{1, 2})
//	assertions.SortedT(t, []string{"a", "b"})
//
// # Examples
//
//	success: []int{1, 1, 3}
//	failure: []int{1, 4, 2}
//
// Upon failure, the test [T] is marked as failed and continues execution.
func SortedT[OrderedSlice ~[]E, E Ordered](t T, collection OrderedSlice, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.SortedT[OrderedSlice, E](t, collection, msgAndArgs...)
}

// StringContainsT asserts that a string contains the specified substring.
//
// Strings may be go strings or []byte according to the type constraint [Text].
//
// # Usage
//
//	assertions.StringContainsT(t, "Hello World", "World")
//
// # Examples
//
//	success: "AB", "A"
//	failure: "AB", "C"
//
// Upon failure, the test [T] is marked as failed and continues execution.
func StringContainsT[ADoc, EDoc Text](t T, str ADoc, substring EDoc, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.StringContainsT[ADoc, EDoc](t, str, substring, msgAndArgs...)
}

// StringNotContainsT asserts that a string does not contain the specified substring.
//
// See [StringContainsT].
//
// # Usage
//
//	assertions.StringNotContainsT(t, "Hello World", "hi")
//
// # Examples
//
//	success: "AB", "C"
//	failure: "AB", "A"
//
// Upon failure, the test [T] is marked as failed and continues execution.
func StringNotContainsT[ADoc, EDoc Text](t T, str ADoc, substring EDoc, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.StringNotContainsT[ADoc, EDoc](t, str, substring, msgAndArgs...)
}

// Subset asserts that the list (array, slice, or map) contains all elements
// given in the subset (array, slice, or map).
//
// Map elements are key-value pairs unless compared with an array or slice where
// only the map key is evaluated.
//
// nil values are considered as empty sets.
//
// # Usage
//
//	assertions.Subset(t, []int{1, 2, 3}, []int{1, 2})
//	assertions.Subset(t, []string{"x": 1, "y": 2}, []string{"x": 1})
//	assertions.Subset(t, []int{1, 2, 3}, map[int]string{1: "one", 2: "two"})
//	assertions.Subset(t, map[string]int{"x": 1, "y": 2}, []string{"x"})
//
// # Examples
//
//	success: []int{1, 2, 3}, []int{1, 2}
//	failure: []int{1, 2, 3}, []int{4, 5}
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Subset(t T, list any, subset any, msgAndArgs ...any) (ok bool) {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.Subset(t, list, subset, msgAndArgs...)
}

// True asserts that the specified value is true.
//
// # Usage
//
//	assertions.True(t, myBool)
//
// # Examples
//
//	success: 1 == 1
//	failure: 1 == 0
//
// Upon failure, the test [T] is marked as failed and continues execution.
func True(t T, value bool, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.True(t, value, msgAndArgs...)
}

// TrueT asserts that the specified value is true.
//
// The type constraint [Boolean] accepts any type which underlying type is bool.
//
// # Usage
//
//	type B bool
//	var b B = true
//
//	assertions.True(t, b)
//
// # Examples
//
//	success: 1 == 1
//	failure: 1 == 0
//
// Upon failure, the test [T] is marked as failed and continues execution.
func TrueT[B Boolean](t T, value B, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.TrueT[B](t, value, msgAndArgs...)
}

// WithinDuration asserts that the two times are within duration delta of each other.
//
// # Usage
//
//	assertions.WithinDuration(t, time.Now(), 10*time.Second)
//
// # Examples
//
//	success: time.Date(2024, 1, 1, 12, 0, 0, 0, time.UTC), time.Date(2024, 1, 1, 12, 0, 1, 0, time.UTC), 2*time.Second
//	failure: time.Date(2024, 1, 1, 12, 0, 0, 0, time.UTC), time.Date(2024, 1, 1, 12, 0, 10, 0, time.UTC), 1*time.Second
//
// Upon failure, the test [T] is marked as failed and continues execution.
func WithinDuration(t T, expected time.Time, actual time.Time, delta time.Duration, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.WithinDuration(t, expected, actual, delta, msgAndArgs...)
}

// WithinRange asserts that a time is within a time range (inclusive).
//
// # Usage
//
//	assertions.WithinRange(t, time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second))
//
// # Examples
//
//	success: time.Date(2024, 1, 1, 12, 0, 0, 0, time.UTC), time.Date(2024, 1, 1, 11, 0, 0, 0, time.UTC), time.Date(2024, 1, 1, 13, 0, 0, 0, time.UTC)
//	failure: time.Date(2024, 1, 1, 14, 0, 0, 0, time.UTC), time.Date(2024, 1, 1, 11, 0, 0, 0, time.UTC), time.Date(2024, 1, 1, 13, 0, 0, 0, time.UTC)
//
// Upon failure, the test [T] is marked as failed and continues execution.
func WithinRange(t T, actual time.Time, start time.Time, end time.Time, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.WithinRange(t, actual, start, end, msgAndArgs...)
}

// YAMLEq asserts that two YAML strings are equivalent.
//
// See [YAMLEqBytes].
//
// # Examples
//
//	panic: "key: value", "key: value"
//	should panic without the yaml feature enabled.
//
// Upon failure, the test [T] is marked as failed and continues execution.
func YAMLEq(t T, expected string, actual string, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.YAMLEq(t, expected, actual, msgAndArgs...)
}

// YAMLEqBytes asserts that two YAML slices of bytes are equivalent.
//
// Expected and actual must be valid YAML.
//
// # Important
//
// By default, this function is disabled and will panic.
//
// To enable it, you should add a blank import like so:
//
//	import(
//	  "github.com/go-openapi/testify/enable/yaml/v2"
//	)
//
// For dynamic redaction of the input text via a callback, use [YAMLEqT].
//
// # Usage
//
//	expected := `---
//	key: value
//	---
//	key: this is a second document, it is not evaluated
//	`
//	actual := `---
//	key: value
//	---
//	key: this is a subsequent document, it is not evaluated
//	`
//	assertions.YAMLEq(t, expected, actual)
//
// # Examples
//
//	panic: []byte("key: value"), []byte("key: value")
//	should panic without the yaml feature enabled.
//
// Upon failure, the test [T] is marked as failed and continues execution.
func YAMLEqBytes(t T, expected []byte, actual []byte, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.YAMLEqBytes(t, expected, actual, msgAndArgs...)
}

// YAMLEqT asserts that two YAML documents are equivalent.
//
// The expected and actual arguments may be string or []byte. They do not need to be of the same type.
//
// See [YAMLEqBytes].
//
// NOTE: passed values (expected, actual) may be wrapped as functions to redact the input text dynamically.
//
// # Examples
//
//	panic: "key: value", "key: value"
//	should panic without the yaml feature enabled.
//
// Upon failure, the test [T] is marked as failed and continues execution.
func YAMLEqT[EDoc, ADoc RText](t T, expected EDoc, actual ADoc, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.YAMLEqT[EDoc, ADoc](t, expected, actual, msgAndArgs...)
}

// YAMLMarshalAsT wraps [YAMLEq] after [yaml.Marshal].
//
// The input YAML may be a string or []byte.
//
// It fails if the marshaling returns an error or if the expected YAML bytes differ semantically
// from the expected ones.
//
// NOTE: passed expected value may be wrapped as a function to redact the input text dynamically.
//
// # Usage
//
//	expected := struct {
//		A int `yaml:"a"`
//	}{
//		A: 10,
//	}
//
//	assertions.YAMLUnmarshalAsT(t,expected, `{"a": 10}`)
//
// # Examples
//
//	panic: "key: value", "key: value"
//	should panic without the yaml feature enabled.
//
// Upon failure, the test [T] is marked as failed and continues execution.
func YAMLMarshalAsT[EDoc RText](t T, expected EDoc, object any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.YAMLMarshalAsT[EDoc](t, expected, object, msgAndArgs...)
}

// YAMLUnmarshalAsT wraps [Equal] after [yaml.Unmarshal].
//
// The input YAML may be a string or []byte.
//
// It fails if the unmarshaling returns an error or if the resulting object is not equal to the expected one.
//
// Be careful not to wrap the expected object into an "any" interface if this is not what you expected:
// the unmarshaling would take this type to unmarshal as a map[string]any.
//
// NOTE: passed yamlDoc value may be wrapped as a function to redact the input text dynamically.
//
// # Usage
//
//	expected := struct {
//		A int `yaml:"a"`
//	}{
//		A: 10,
//	}
//
//	assertions.YAMLUnmarshalAsT(t,expected, `{"a": 10}`)
//
// # Examples
//
//	panic: "key: value", "key: value"
//	should panic without the yaml feature enabled.
//
// Upon failure, the test [T] is marked as failed and continues execution.
func YAMLUnmarshalAsT[Object any, ADoc RText](t T, expected Object, yamlDoc ADoc, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.YAMLUnmarshalAsT[Object, ADoc](t, expected, yamlDoc, msgAndArgs...)
}

// Zero asserts that i is the zero value for its type.
//
// # Usage
//
//	assertions.Zero(t, obj)
//
// # Examples
//
//	success: 0
//	failure: 1
//
// Upon failure, the test [T] is marked as failed and continues execution.
func Zero(t T, i any, msgAndArgs ...any) bool {
	if h, ok := t.(H); ok {
		h.Helper()
	}
	return assertions.Zero(t, i, msgAndArgs...)
}
