package assert
import "gotest.tools/v3/internal/assert"
Package assert provides internal utilties for assertions.
Index ¶
- func ArgsAfterT(args []ast.Expr) []ast.Expr
- func ArgsAtZeroIndex(args []ast.Expr) []ast.Expr
- func ArgsFromComparisonCall(args []ast.Expr) []ast.Expr
- func Eval( t LogT, argSelector argSelector, comparison interface{}, msgAndArgs ...interface{}, ) bool
- func RunComparison( t LogT, argSelector argSelector, f cmp.Comparison, msgAndArgs ...interface{}, ) bool
- type LogT
Functions ¶
func ArgsAfterT ¶
ArgsAfterT selects args starting at position 1. Used when the caller has a testing.T as the first argument, and the args to select should follow it.
func ArgsAtZeroIndex ¶
ArgsAtZeroIndex selects args from the CallExpression at position 1. Used when the caller accepts a single cmp.Comparison argument.
func ArgsFromComparisonCall ¶
ArgsFromComparisonCall selects args from the CallExpression at position 1. Used when the caller has a testing.T as the first argument, and the args to select are passed to the cmp.Comparison at position 1.
func Eval ¶
func Eval( t LogT, argSelector argSelector, comparison interface{}, msgAndArgs ...interface{}, ) bool
Eval the comparison and print a failure messages if the comparison has failed.
func RunComparison ¶
func RunComparison( t LogT, argSelector argSelector, f cmp.Comparison, msgAndArgs ...interface{}, ) bool
RunComparison and return Comparison.Success. If the comparison fails a messages will be printed using t.Log.
Types ¶
type LogT ¶
type LogT interface {
Log(args ...interface{})
}
LogT is the subset of testing.T used by the assert package.
Source Files ¶
assert.go result.go
- Version
- v3.5.2 (latest)
- Published
- Sep 5, 2024
- Platform
- linux/amd64
- Imports
- 8 packages
- Last checked
- 2 months ago –
Tools for package owners.