github.com/MontFerret/ferret@v0.18.0/pkg/stdlib/testing/equal.go (about) 1 package testing 2 3 import ( 4 "context" 5 "fmt" 6 7 "github.com/MontFerret/ferret/pkg/runtime/core" 8 "github.com/MontFerret/ferret/pkg/stdlib/testing/base" 9 ) 10 11 // EQUAL asserts equality of actual and expected values. 12 // @param {Any} actual - Actual value. 13 // @param {Any} expected - Expected value. 14 // @param {String} [message] - Message to display on error. 15 var Equal = base.Assertion{ 16 DefaultMessage: func(args []core.Value) string { 17 return fmt.Sprintf("be %s %s", base.EqualOp, base.FormatValue(args[1])) 18 }, 19 MinArgs: 2, 20 MaxArgs: 3, 21 Fn: func(ctx context.Context, args []core.Value) (bool, error) { 22 return base.EqualOp.Compare(args) 23 }, 24 }