MCPcopy Create free account

hub / github.com/expr-lang/expr / functions

Functions2,191 in github.com/expr-lang/expr

↓ 756 callersFunctionaddFormatterTest
addFormatterTest is a helper method to append the passed input and desired result to formatterTests.
internal/spew/format_test.go:90
↓ 612 callersMethodSprintf
Sprintf is a wrapper for fmt.Sprintf that treats each argument as if it were passed with a Formatter interface returned by c.NewFormatter. It returns
internal/spew/config.go:208
↓ 575 callersMethodHelper
()
internal/testify/assert/assertion_compare_test.go:108
↓ 535 callersFunctionNoError
NoError asserts that a function returned no error (i.e. `nil`). actualObj, err := SomeFunction() if assert.NoError(t, err) { assert.Equal(
internal/testify/require/require.go:1351
↓ 285 callersFunctionCompile
Compile parses and compiles given input expression to bytecode program.
expr.go:229
↓ 236 callersMethodErrorf
(format string, args ...interface{})
internal/testify/require/requirements.go:5
↓ 215 callersMethodemit
(op Opcode, args ...int)
compiler/compiler.go:122
↓ 206 callersFunctionaddDumpTest
addDumpTest is a helper method to append the passed input and desired result to dumpTests
internal/spew/dump_test.go:84
↓ 199 callersMethodRun
(program *Program, env any)
vm/vm.go:54
↓ 178 callersFunctionEqual
Equal asserts that two objects are equal. assert.Equal(t, 123, 123) Pointer variable equality is determined based on the equality of the referenced
internal/testify/assert/assertions.go:458
↓ 175 callersMethodString
()
ast/node.go:22
↓ 166 callersFunctionRun
Run evaluates given bytecode program.
expr.go:264
↓ 164 callersFunctionEqual
Equal asserts that two objects are equal. assert.Equal(t, 123, 123) Pointer variable equality is determined based on the equality of the referenced
internal/testify/require/require.go:156
↓ 161 callersMethodpop
()
vm/vm.go:678
↓ 159 callersMethodError
()
internal/testify/assert/assertions_test.go:1477
↓ 144 callersMethodFailNow
()
internal/testify/require/requirements.go:6
↓ 124 callersFunctionTrue
True asserts that the specified value is true. assert.True(t, myBool)
internal/testify/assert/assertions.go:812
↓ 122 callersFunctionFalse
False asserts that the specified value is false. assert.False(t, myBool)
internal/testify/assert/assertions.go:827
↓ 122 callersMethodWrite
([]byte)
test/coredns/coredns.go:174
↓ 115 callersFunctionFail
Fail reports a failure through
internal/testify/assert/assertions.go:346
↓ 104 callersMethodcompile
(node ast.Node)
compiler/compiler.go:216
↓ 84 callersMethodElem
(c *Cache)
checker/nature/nature.go:245
↓ 80 callersFunctionParse
(input string)
parser/parser.go:143
↓ 79 callersMethodFromType
FromType returns a Nature describing a value of type "t". If "t" is nil then it returns a Nature describing an unknown value.
checker/nature/nature.go:118
↓ 75 callersMethodType
()
ast/node.go:20
↓ 74 callersMethodPrintf
Printf is a wrapper for fmt.Printf that treats each argument as if it were passed with a Formatter interface returned by c.NewFormatter. It returns t
internal/spew/config.go:174
↓ 72 callersMethodpush
(value any)
vm/vm.go:667
↓ 68 callersMethodError
Error asserts that a function returned an error (i.e. not `nil`). actualObj, err := SomeFunction() if a.Error(err) { assert.Equal(t, expec
internal/testify/require/require_forward.go:233
↓ 66 callersMethodderefInNeeded
(node ast.Node)
compiler/compiler.go:1315
↓ 64 callersFunctionRun
(program *Program, env any)
vm/vm.go:22
↓ 64 callersMethoderror
(node ast.Node, format string, args ...any)
checker/checker.go:239
↓ 62 callersFunctionDump
(node Node)
ast/dump.go:9
↓ 61 callersFunctionError
Error asserts that a function returned an error (i.e. not `nil`). actualObj, err := SomeFunction() if assert.Error(t, err) { assert.Equal(
internal/testify/require/require.go:287
↓ 58 callersFunctionNew
New makes a new Assertions object for the specified TestingT.
internal/testify/assert/forward_assertions.go:10
↓ 56 callersFunctionNew
New makes a new Assertions object for the specified TestingT.
internal/testify/require/forward_requirements.go:10
↓ 50 callersMethodError
()
file/error.go:17
↓ 50 callersMethodIs
(kind Kind, values ...string)
parser/lexer/token.go:34
↓ 50 callersMethodIsUnknown
(c *Cache)
checker/nature/nature.go:219
↓ 50 callersFunctionNoError
* Errors */ NoError asserts that a function returned no error (i.e. `nil`). actualObj, err := SomeFunction() if assert.NoError(t, err) {
internal/testify/assert/assertions.go:1544
↓ 49 callersMethodvisit
(node ast.Node)
checker/checker.go:183
↓ 45 callersMethodDuration
(s string)
docgen/docgen_test.go:42
↓ 43 callersMethodEqual
(Type)
types/types.go:14
↓ 43 callersFunctionEval
Eval parses, compiles and runs given input.
expr.go:269
↓ 43 callersMethodFalse
False asserts that the specified value is false. a.False(myBool)
internal/testify/assert/assertion_forward.go:438
↓ 43 callersFunctionTrue
True asserts that the specified value is true. assert.True(t, myBool)
internal/testify/require/require.go:1944
↓ 42 callersFunctionnode
(depth int)
test/gen/gen.go:140
↓ 41 callersMethodTrue
True asserts that the specified value is true. a.True(myBool)
internal/testify/assert/assertion_forward.go:1534
↓ 40 callersFunctionContains
Contains asserts that the specified string, list(array, slice...) or map contains the specified substring or element. assert.Contains(t, "Hello Worl
internal/testify/assert/assertions.go:926
↓ 40 callersFunctionassertEqual
(t *testing.T, a, b interface{})
internal/difflib/difflib_test.go:18
↓ 40 callersFunctiontypes
(types ...any)
builtin/utils.go:29
↓ 36 callersFunctionOptimize
(node *Node, config *conf.Config)
optimizer/optimizer.go:11
↓ 33 callersMethodcreateNode
(n Node, loc file.Location)
parser/parser.go:116
↓ 32 callersFunctionNew
New creates new config with environment.
conf/config.go:64
↓ 30 callersMethodexpect
(kind Kind, values ...string)
parser/parser.go:189
↓ 29 callersFunctionFunction
Function adds function to list of functions what will be available in expressions.
expr.go:152
↓ 28 callersFunctionCheck
Check calls Check on a disposable Checker.
checker/checker.go:49
↓ 28 callersFunctionEmpty
Empty asserts that the specified object is empty. I.e. nil, "", false, 0 or either a slice or a channel with len == 0. assert.Empty(t, obj)
internal/testify/assert/assertions.go:748
↓ 26 callersMethodFprintf
Fprintf is a wrapper for fmt.Fprintf that treats each argument as if it were passed with a Formatter interface returned by c.NewFormatter. It returns
internal/spew/config.go:139
↓ 26 callersMethodnext
()
parser/parser.go:164
↓ 26 callersMethodpatchJump
(placeholder int)
compiler/compiler.go:207
↓ 25 callersMethodNumIn
()
checker/nature/nature.go:306
↓ 25 callersMethodnext
()
parser/lexer/lexer.go:79
↓ 24 callersMethodLen
()
vm/runtime/sort.go:31
↓ 24 callersMethodemitPush
(value any)
compiler/compiler.go:137
↓ 24 callersFunctionisEmpty
isEmpty gets whether the specified object is considered empty or not.
internal/testify/assert/assertions.go:716
↓ 23 callersMethodDeref
(c *Cache)
checker/nature/nature.go:230
↓ 23 callersMethodLen
Len asserts that the specified object has specific length. Len also fails if the object has a type that len() not accept. a.Len(mySlice, 3)
internal/testify/assert/assertion_forward.go:911
↓ 23 callersMethodName
()
internal/testify/require/requirements_test.go:415
↓ 23 callersFunctionrep
(s string, count int)
internal/difflib/difflib_test.go:210
↓ 22 callersMethodAdd
(a int, b *int)
test/issues/688/issue_test.go:11
↓ 22 callersFunctionContains
Contains asserts that the specified string, list(array, slice...) or map contains the specified substring or element. assert.Contains(t, "Hello Worl
internal/testify/require/require.go:41
↓ 22 callersFunctionOperator
Operator allows to replace a binary operator with a function.
expr.go:44
↓ 22 callersFunctiontoInteger
(n Node)
optimizer/fold.go:321
↓ 20 callersMethodIn
(c *Cache, i int)
checker/nature/nature.go:324
↓ 20 callersFunctionWalk
(node *Node, v Visitor)
ast/visitor.go:9
↓ 20 callersFunctionsplitChars
(s string)
internal/difflib/difflib_test.go:24
↓ 20 callersFunctiontoFloat
(n Node)
optimizer/fold.go:329
↓ 19 callersMethodContains
Contains asserts that the specified string, list(array, slice...) or map contains the specified substring or element. a.Contains("Hello World", "Wor
internal/testify/assert/assertion_forward.go:33
↓ 19 callersMethodIsNumber
()
checker/nature/nature.go:476
↓ 19 callersMethoderror
(format string, args ...any)
parser/parser.go:151
↓ 18 callersFunctionError
Error asserts that a function returned an error (i.e. not `nil`). actualObj, err := SomeFunction() if assert.Error(t, err) { assert.Equal(
internal/testify/assert/assertions.go:1561
↓ 18 callersMethodFailed
()
internal/testify/assert/assertions_test.go:2458
↓ 18 callersFunctionNil
Nil asserts that the specified object is nil. assert.Nil(t, err)
internal/testify/assert/assertions.go:705
↓ 18 callersMethodNumOut
()
checker/nature/nature.go:336
↓ 18 callersFunctionSplitLines
Split a string on "\n" while preserving them. The output can be used as input for UnifiedDiff and ContextDiff structures.
internal/difflib/difflib.go:771
↓ 18 callersMethodaccept
(valid string)
parser/lexer/lexer.go:145
↓ 18 callersFunctiondiff
diff returns a diff of both values as long as both are of the same type and are a struct, map, slice, array or string. Otherwise it returns an empty s
internal/testify/assert/assertions.go:1794
↓ 18 callersMethodemit
(t Kind)
parser/lexer/lexer.go:108
↓ 18 callersFunctionkind
(t reflect.Type)
builtin/utils.go:21
↓ 18 callersFunctiononeOf
(cases []element[T])
test/gen/utils.go:18
↓ 18 callersMethodparseExpression
(precedence int)
parser/parser.go:220
↓ 17 callersMethodAssignableTo
(nt Nature)
checker/nature/nature.go:263
↓ 17 callersFunctionLen
Len asserts that the specified object has specific length. Len also fails if the object has a type that len() not accept. assert.Len(t, mySlice, 3)
internal/testify/assert/assertions.go:794
↓ 17 callersFunctionNotEmpty
NotEmpty asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either a slice or a channel with len == 0. if assert.NotEmpt
internal/testify/assert/assertions.go:767
↓ 16 callersMethodIsArray
()
checker/nature/nature.go:510
↓ 16 callersMethodIsDuration
()
checker/nature/nature.go:494
↓ 16 callersMethodLocation
()
ast/node.go:16
↓ 16 callersMethodaddConstant
(constant any)
compiler/compiler.go:141
↓ 15 callersFunctionCompile
(tree *parser.Tree, config *conf.Config)
compiler/compiler.go:25
↓ 15 callersMethodError
()
expr_test.go:1678
next →1–100 of 2,191, ranked by callers