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

Function TestParseQueryWithVarValAggNested4

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

Source from the content-addressed store, hash-verified

529}
530
531func TestParseQueryWithVarValAggNested4(t *testing.T) {
532 query := `
533 {
534 me(func: uid(L), orderasc: val(d) ) {
535 name
536 }
537
538 var(func: uid(0x0a)) {
539 L as friends {
540 a as age
541 b as count(friends)
542 c as count(relatives)
543 d as math(exp(a + b + 1.0) - max(c,ln(c)) + sqrt(a%b))
544 }
545 }
546 }
547`
548 res, err := Parse(Request{Str: query})
549 require.NoError(t, err)
550 require.EqualValues(t, "(+ (- (exp (+ (+ a b) 1E+00)) (max c (ln c))) (sqrt (% a b)))",
551 res.Query[1].Children[0].Children[3].MathExp.debugString())
552}
553
554func TestParseQueryWithVarValAggNested5(t *testing.T) {
555 query := `

Callers

nothing calls this directly

Calls 2

ParseFunction · 0.70
debugStringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…