github.com/MontFerret/ferret@v0.18.0/pkg/stdlib/testing/int.go (about)

     1  package testing
     2  
     3  import (
     4  	"context"
     5  
     6  	"github.com/MontFerret/ferret/pkg/runtime/core"
     7  	"github.com/MontFerret/ferret/pkg/runtime/values/types"
     8  	"github.com/MontFerret/ferret/pkg/stdlib/testing/base"
     9  )
    10  
    11  // INT asserts that value is a int type.
    12  // @param {Any} actual - Actual value.
    13  // @param {String} [message] - Message to display on error.
    14  var Int = base.Assertion{
    15  	DefaultMessage: func(args []core.Value) string {
    16  		return "be int"
    17  	},
    18  	MinArgs: 1,
    19  	MaxArgs: 2,
    20  	Fn: func(ctx context.Context, args []core.Value) (bool, error) {
    21  		return args[0].Type() == types.Int, nil
    22  	},
    23  }