github.com/MontFerret/ferret@v0.18.0/pkg/stdlib/testing/gt.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  // GT asserts that an actual value is greater than an expected one.
    12  // @param {Any} actual - Actual value.
    13  // @param {Any} expected - Expected value.
    14  // @param {String} [message] - Message to display on error.
    15  var Gt = base.Assertion{
    16  	DefaultMessage: func(args []core.Value) string {
    17  		return fmt.Sprintf("be %s %s", base.GreaterOp, 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.GreaterOp.Compare(args)
    23  	},
    24  }