MCPcopy Create free account

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

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

↓ 15 callersFunctionInDelta
InDelta asserts that the two numerals are within delta of each other. assert.InDelta(t, math.Pi, 22/7.0, 0.01)
internal/testify/assert/assertions.go:1361
↓ 15 callersMethodSetType
(reflect.Type)
ast/node.go:21
↓ 15 callersFunctioncontainsElement
containsElement try loop over the list check if the list includes the element. return (false, false) if impossible. return (true, false) if element wa
internal/testify/assert/assertions.go:881
↓ 14 callersFunctionAllowUndefinedVariables
AllowUndefinedVariables allows to use undefined variables inside expressions. This can be used with expr.Env option to partially define a few variable
expr.go:37
↓ 14 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/require/require_forward.go:35
↓ 14 callersMethodKey
(c *Cache)
checker/nature/nature.go:238
↓ 14 callersMethodOut
(c *Cache, i int)
checker/nature/nature.go:345
↓ 14 callersFunctionTypeOf
(v any)
types/types.go:37
↓ 14 callersFunctionpatchCopyType
(node *Node, newNode Node)
optimizer/optimizer.go:78
↓ 13 callersFunctionIsNil
(v any)
vm/runtime/runtime.go:428
↓ 13 callersFunctionJSONEq
JSONEq asserts that two JSON strings are equivalent. assert.JSONEq(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`)
internal/testify/assert/assertions.go:1764
↓ 13 callersMethodSdump
Sdump returns a string with the passed arguments formatted exactly the same as Dump.
internal/spew/config.go:279
↓ 13 callersMethodemitLoop
(body func())
compiler/compiler.go:1195
↓ 12 callersMethodCheck
()
conf/config.go:88
↓ 12 callersFunctionNotNil
NotNil asserts that the specified object is not nil. assert.NotNil(t, err)
internal/testify/assert/assertions.go:673
↓ 12 callersFunctionPatch
Patch adds visitor to list of visitors what will be applied before compiling AST to bytecode.
expr.go:145
↓ 12 callersMethodSprint
Sprint is a wrapper for fmt.Sprint that treats each argument as if it were passed with a Formatter interface returned by c.NewFormatter. It returns t
internal/spew/config.go:197
↓ 12 callersMethodString
()
test/coredns/coredns.go:159
↓ 12 callersMethoderror
(format string, args ...any)
parser/lexer/lexer.go:163
↓ 12 callersMethoderrorString
()
internal/testify/assert/assertions_test.go:2449
↓ 12 callersFunctionrandom
(array []T)
test/gen/utils.go:33
↓ 11 callersMethodGet
(string)
test/interface/interface_test.go:11
↓ 11 callersMethodIsString
()
checker/nature/nature.go:502
↓ 11 callersFunctionJSONEq
JSONEq asserts that two JSON strings are equivalent. assert.JSONEq(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`)
internal/testify/require/require.go:1126
↓ 11 callersMethodMaybeCompatible
(c *Cache, rhs Nature, cs ...NatureCheck)
checker/nature/nature.go:567
↓ 11 callersFunctionObjectsAreEqual
* Helper functions */ ObjectsAreEqual determines if two objects are considered equal. This function does no assertion of any kind.
internal/testify/assert/assertions.go:62
↓ 11 callersMethodSplit
(s, sep string)
test/mock/mock.go:224
↓ 11 callersFunctionToInt
(a any)
vm/runtime/runtime.go:323
↓ 11 callersFunctionWithinDuration
WithinDuration asserts that the two times are within duration delta of each other. assert.WithinDuration(t, time.Now(), time.Now(), 10*time.Second)
internal/testify/assert/assertions.go:1286
↓ 10 callersFunctionAsBool
AsBool tells the compiler to expect a boolean result.
expr.go:81
↓ 10 callersFunctionCreateNew
CreateNew creates new config with default values.
conf/config.go:47
↓ 10 callersMethodEmpty
Empty asserts that the specified object is empty. I.e. nil, "", false, 0 or either a slice or a channel with len == 0. a.Empty(obj)
internal/testify/assert/assertion_forward.go:99
↓ 10 callersMethodFieldByName
(c *Cache, name string)
checker/nature/nature.go:373
↓ 10 callersFunctionHTTPSuccess
HTTPSuccess asserts that a specified handler returns a success status code. assert.HTTPSuccess(t, myHandler, "POST", "http://www.google.com", nil)
internal/testify/assert/http_assertions.go:29
↓ 10 callersMethodIsBool
()
checker/nature/nature.go:498
↓ 10 callersMethodIsFunc
()
checker/nature/nature.go:522
↓ 10 callersMethodIsTime
()
checker/nature/nature.go:490
↓ 10 callersFunctionIsType
IsType asserts that the specified objects are of the same type.
internal/testify/require/require.go:1102
↓ 10 callersMethodJSONEq
JSONEq asserts that two JSON strings are equivalent. a.JSONEq(`{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`)
internal/testify/assert/assertion_forward.go:890
↓ 10 callersMethodJSONEq
JSONEq asserts that two JSON strings are equivalent. a.JSONEq(`{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`)
internal/testify/require/require_forward.go:892
↓ 10 callersFunctionNewMatcher
(a, b []string)
internal/difflib/difflib.go:100
↓ 10 callersMethodNotEmpty
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 a.NotEmpty(obj
internal/testify/assert/assertion_forward.go:1137
↓ 10 callersFunctionPatch
Patch replaces the node with a new one. Location information is preserved. Type information is lost.
ast/node.go:28
↓ 10 callersFunctionRegexp
Regexp asserts that a specified regexp matches a string. assert.Regexp(t, regexp.MustCompile("start"), "it's starting") assert.Regexp(t, "start...$
internal/testify/assert/assertions.go:1634
↓ 10 callersFunctionWithinRange
WithinRange asserts that a time is within a time range (inclusive). assert.WithinRange(t, time.Now(), time.Now().Add(-time.Second), time.Now().Add(t
internal/testify/assert/assertions.go:1302
↓ 10 callersMethodbegin
(collectionNature Nature, vars ...varScope)
checker/checker.go:948
↓ 10 callersFunctionconvertArgs
convertArgs accepts a slice of arguments and returns a slice of the same length with each argument converted to a default spew Formatter interface.
internal/spew/spew.go:142
↓ 10 callersMethodconvertArgs
convertArgs accepts a slice of arguments and returns a slice of the same length with each argument converted to a spew Formatter interface using the C
internal/spew/config.go:288
↓ 10 callersMethodend
()
checker/checker.go:955
↓ 9 callersFunctionArray
Array returns a type that represents an array of the given type.
types/types.go:149
↓ 9 callersFunctionIsDecreasing
IsDecreasing asserts that the collection is decreasing assert.IsDecreasing(t, []int{2, 1, 0}) assert.IsDecreasing(t, []float{2, 1}) assert.IsDecre
internal/testify/assert/assertion_order.go:70
↓ 9 callersMethodIsFirstArgUnknown
(c *Cache)
checker/nature/nature.go:328
↓ 9 callersFunctionIsIncreasing
IsIncreasing asserts that the collection is increasing assert.IsIncreasing(t, []int{1, 2, 3}) assert.IsIncreasing(t, []float{1, 2}) assert.IsIncre
internal/testify/assert/assertion_order.go:52
↓ 9 callersFunctionIsNonDecreasing
IsNonDecreasing asserts that the collection is not decreasing assert.IsNonDecreasing(t, []int{1, 1, 2}) assert.IsNonDecreasing(t, []float{1, 2}) a
internal/testify/assert/assertion_order.go:79
↓ 9 callersFunctionIsNonIncreasing
IsNonIncreasing asserts that the collection is not increasing assert.IsNonIncreasing(t, []int{2, 1, 1}) assert.IsNonIncreasing(t, []float{2, 1}) a
internal/testify/assert/assertion_order.go:61
↓ 9 callersMethodNatureOf
NatureOf returns a Nature describing "i". If "i" is nil then it returns a Nature describing the value "nil".
checker/nature/nature.go:107
↓ 9 callersFunctionNegative
Negative asserts that the specified element is negative assert.Negative(t, -1) assert.Negative(t, -1.23)
internal/testify/assert/assertion_compare.go:450
↓ 9 callersFunctionNotNil
NotNil asserts that the specified object is not nil. assert.NotNil(t, err)
internal/testify/require/require.go:1576
↓ 9 callersFunctionPanicsWithError
PanicsWithError asserts that the code inside the specified PanicTestFunc panics, and that the recovered panic value is an error that satisfies the Equ
internal/testify/assert/assertions.go:1251
↓ 9 callersFunctionPositive
Positive asserts that the specified element is positive assert.Positive(t, 1) assert.Positive(t, 1.23)
internal/testify/assert/assertion_compare.go:438
↓ 9 callersMethodPrintln
Println is a wrapper for fmt.Println that treats each argument as if it were passed with a Formatter interface returned by c.NewFormatter. It returns
internal/spew/config.go:186
↓ 9 callersMethodString
()
types/types.go:15
↓ 9 callersFunctionType
(t reflect.Type)
internal/deref/deref.go:29
↓ 9 callersFunctionValue
(v reflect.Value)
internal/deref/deref.go:39
↓ 9 callersFunctioncompareTwoValues
(t TestingT, e1 interface{}, e2 interface{}, allowedComparesResults []compareResult, failMessage string, msgAn
internal/testify/assert/assertion_compare.go:458
↓ 9 callersFunctiondidPanic
didPanic returns true if the function passed to it panics. Otherwise, it returns false.
internal/testify/assert/assertions.go:1194
↓ 9 callersMethodindent
indent performs indentation according to the depth level and cs.Indent option.
internal/spew/dump.go:62
↓ 9 callersMethodpeek
()
parser/lexer/lexer.go:90
↓ 8 callersFunctionDirExists
DirExists checks whether a directory exists in the given path. It also fails if the path is a file rather a directory or there is an error checking wh
internal/testify/assert/assertions.go:1725
↓ 8 callersMethodDisassemble
Disassemble returns opcodes as a string.
vm/program.go:76
↓ 8 callersFunctionFileExists
FileExists checks whether a file exists in the given path. It also fails if the path points to a directory or there is an error when trying to check t
internal/testify/assert/assertions.go:1690
↓ 8 callersMethodFlag
(f int)
internal/spew/internal_test.go:38
↓ 8 callersFunctionGreater
Greater asserts that the first element is greater than the second assert.Greater(t, 2, 1) assert.Greater(t, float64(2), float64(1)) assert.Greater
internal/testify/assert/assertion_compare.go:389
↓ 8 callersFunctionGreaterOrEqual
GreaterOrEqual asserts that the first element is greater than or equal to the second assert.GreaterOrEqual(t, 2, 1) assert.GreaterOrEqual(t, 2, 2)
internal/testify/assert/assertion_compare.go:402
↓ 8 callersFunctionIsType
IsType asserts that the specified objects are of the same type.
internal/testify/assert/assertions.go:439
↓ 8 callersFunctionLess
Less asserts that the first element is less than the second assert.Less(t, 1, 2) assert.Less(t, float64(1), float64(2)) assert.Less(t, "a", "b")
internal/testify/assert/assertion_compare.go:414
↓ 8 callersFunctionLessOrEqual
LessOrEqual asserts that the first element is less than or equal to the second assert.LessOrEqual(t, 1, 2) assert.LessOrEqual(t, 2, 2) assert.Less
internal/testify/assert/assertion_compare.go:427
↓ 8 callersMethodMethodByName
(c *Cache, name string)
checker/nature/nature.go:297
↓ 8 callersFunctionNoDirExists
NoDirExists checks whether a directory does not exist in the given path. It fails if the path points to an existing _directory_ only.
internal/testify/assert/assertions.go:1744
↓ 8 callersFunctionNoFileExists
NoFileExists checks whether a file does not exist in a given path. It fails if the path points to an existing _file_ only.
internal/testify/assert/assertions.go:1709
↓ 8 callersFunctionNotPanics
NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic. assert.NotPanics(t, func(){ RemainCalm() })
internal/testify/assert/assertions.go:1271
↓ 8 callersFunctionPanics
Panics asserts that the code inside the specified PanicTestFunc panics. assert.Panics(t, func(){ GoCrazy() })
internal/testify/assert/assertions.go:1214
↓ 8 callersMethodParse
(input string, config *conf.Config)
parser/parser.go:60
↓ 8 callersFunctionWithContext
WithContext passes context to all functions calls with a context.Context argument.
expr.go:197
↓ 8 callersMethodWithinDuration
WithinDuration asserts that the two times are within duration delta of each other. a.WithinDuration(time.Now(), time.Now(), 10*time.Second)
internal/testify/assert/assertion_forward.go:1554
↓ 8 callersFunctionformatUnequalValues
formatUnequalValues takes two values of arbitrary types and returns string representations appropriate to be presented to the user. If the values are
internal/testify/assert/assertions.go:554
↓ 8 callersFunctiongetTempSymlinkPath
(file string)
internal/testify/assert/assertions_test.go:2113
↓ 7 callersFunctionConstExpr
ConstExpr defines func expression as constant. If all argument to this function is constants, then it can be replaced by result of this func call on c
expr.go:59
↓ 7 callersFunctionEqualError
EqualError asserts that a function returned an error (i.e. not `nil`) and that it is equal to the provided error. actualObj, err := SomeFunction()
internal/testify/require/require.go:171
↓ 7 callersFunctionErrorContains
ErrorContains asserts that a function returned an error (i.e. not `nil`) and that the error contains the specified substring. actualObj, err := Some
internal/testify/assert/assertions.go:1600
↓ 7 callersFunctionEventuallyWithT
EventuallyWithT asserts that given condition will be met in waitFor time, periodically checking target function each tick. In contrast to Eventually,
internal/testify/assert/assertions.go:1941
↓ 7 callersFunctionFalse
False asserts that the specified value is false. assert.False(t, myBool)
internal/testify/require/require.go:548
↓ 7 callersFunctionHTTPBodyContains
HTTPBodyContains asserts that a specified handler returns a body that contains a string. assert.HTTPBodyContains(t, myHandler, "GET", "www.google.co
internal/testify/assert/http_assertions.go:133
↓ 7 callersFunctionHTTPError
HTTPError asserts that a specified handler returns an error status code. assert.HTTPError(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"
internal/testify/assert/http_assertions.go:73
↓ 7 callersFunctionHTTPRedirect
HTTPRedirect asserts that a specified handler returns a redirect status code. assert.HTTPRedirect(t, myHandler, "GET", "/a/b/c", url.Values{"a": []s
internal/testify/assert/http_assertions.go:51
↓ 7 callersFunctionHTTPStatusCode
HTTPStatusCode asserts that a specified handler returns a specified status code. assert.HTTPStatusCode(t, myHandler, "GET", "/notImplemented", nil,
internal/testify/assert/http_assertions.go:95
↓ 7 callersMethodImplements
Implements asserts that an object is implemented by the specified interface. a.Implements((*MyInterface)(nil), new(MyObject))
internal/testify/require/require_forward.go:676
↓ 7 callersMethodInDelta
InDelta asserts that the two numerals are within delta of each other. a.InDelta(math.Pi, 22/7.0, 0.01)
internal/testify/assert/assertion_forward.go:694
↓ 7 callersFunctionInDeltaSlice
InDeltaSlice is the same as InDelta, except it compares two slices.
internal/testify/assert/assertions.go:1394
↓ 7 callersMethodMarkdown
()
docgen/markdown.go:9
← previousnext →101–200 of 2,191, ranked by callers