MCPcopy Create free account
hub / github.com/expr-lang/expr / TestParse_pipe_operator

Function TestParse_pipe_operator

parser/parser_test.go:1201–1222  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1199}
1200
1201func TestParse_pipe_operator(t *testing.T) {
1202 input := "arr | map(.foo) | len() | Foo()"
1203 expect := &CallNode{
1204 Callee: &IdentifierNode{Value: "Foo"},
1205 Arguments: []Node{
1206 &BuiltinNode{
1207 Name: "len",
1208 Arguments: []Node{
1209 &BuiltinNode{
1210 Name: "map",
1211 Arguments: []Node{
1212 &IdentifierNode{Value: "arr"},
1213 &PredicateNode{
1214 Node: &MemberNode{
1215 Node: &PointerNode{},
1216 Property: &StringNode{Value: "foo"},
1217 }}}}}}}}
1218
1219 actual, err := parser.Parse(input)
1220 require.NoError(t, err)
1221 assert.Equal(t, Dump(expect), Dump(actual.Node))
1222}
1223
1224func TestNodeBudget(t *testing.T) {
1225 tests := []struct {

Callers

nothing calls this directly

Calls 4

ParseFunction · 0.92
NoErrorFunction · 0.92
EqualFunction · 0.92
DumpFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…