1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-03-21 21:47:43 +02:00

25 lines
669 B
Go
Raw Normal View History

package testing
import (
"context"
"fmt"
"github.com/MontFerret/ferret/pkg/runtime/core"
"github.com/MontFerret/ferret/pkg/stdlib/testing/base"
)
// Gt asserts that an actual value is greater than an expected one.
// @params actual (Mixed) - Actual value.
// @params expected (Mixed) - Expected value.
// @params message (String, optional) - Message to display on error.
var Gt = base.Assertion{
DefaultMessage: func(args []core.Value) string {
return fmt.Sprintf("be %s %s", base.GreaterOp, base.FormatValue(args[1]))
},
MinArgs: 2,
MaxArgs: 3,
Fn: func(ctx context.Context, args []core.Value) (bool, error) {
return base.GreaterOp.Compare(args)
},
}