MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / TestParseQueryWithVarValAggNested

Function TestParseQueryWithVarValAggNested

dql/parser_test.go:481–502  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

479 require.Contains(t, err.Error(), "Empty () not allowed in math block")
480}
481func TestParseQueryWithVarValAggNested(t *testing.T) {
482 query := `
483 {
484 me(func: uid(L), orderasc: val(d)) {
485 name
486 }
487
488 var(func: uid(0x0a)) {
489 L as friends {
490 a as age
491 b as count(friends)
492 c as count(relatives)
493 d as math(a + b*c)
494 }
495 }
496 }
497`
498 res, err := Parse(Request{Str: query})
499 require.EqualValues(t, "(+ a (* b c))",
500 res.Query[1].Children[0].Children[3].MathExp.debugString())
501 require.NoError(t, err)
502}
503
504func TestParseQueryWithVarValAggNested2(t *testing.T) {
505 query := `

Callers

nothing calls this directly

Calls 2

ParseFunction · 0.70
debugStringMethod · 0.45

Tested by

no test coverage detected