MCPcopy
hub / github.com/dgraph-io/dgraph / TestParseQueryWithVarValAggNested3

Function TestParseQueryWithVarValAggNested3

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

Source from the content-addressed store, hash-verified

676}
677
678func TestParseQueryWithVarValAggNested3(t *testing.T) {
679 query := `
680 {
681 me(func: uid(L), orderasc: val(d) ) {
682 name
683 }
684
685 var(func: uid(0x0a)) {
686 L as friends {
687 a as age
688 b as count(friends)
689 c as count(relatives)
690 d as math(a + b * c / a + exp(a + b + 1.0) - ln(c))
691 }
692 }
693 }
694`
695 res, err := Parse(Request{Str: query})
696 require.NoError(t, err)
697 require.EqualValues(t, "(+ (+ a (/ (* b c) a)) (- (exp (+ (+ a b) 1E+00)) (ln c)))",
698 res.Query[1].Children[0].Children[3].MathExp.debugString())
699}
700
701func TestParseQueryWithVarValAggNested_Error1(t *testing.T) {
702 // No args to mulvar.

Callers

nothing calls this directly

Calls 2

ParseFunction · 0.70
debugStringMethod · 0.45

Tested by

no test coverage detected