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

Function TestParseQueryWithVarValAggLogSqrt

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

Source from the content-addressed store, hash-verified

575}
576
577func TestParseQueryWithVarValAggLogSqrt(t *testing.T) {
578 query := `
579 {
580 me(func: uid(L), orderasc: val(d) ) {
581 name
582 val(e)
583 }
584
585 var(func: uid(0x0a)) {
586 L as friends {
587 a as age
588 d as math(ln(sqrt(a)))
589 e as math(sqrt(ln(a)))
590 }
591 }
592 }
593`
594 res, err := Parse(Request{Str: query})
595 require.NoError(t, err)
596 require.EqualValues(t, "(ln (sqrt a))",
597 res.Query[1].Children[0].Children[1].MathExp.debugString())
598 require.EqualValues(t, "(sqrt (ln a))",
599 res.Query[1].Children[0].Children[2].MathExp.debugString())
600}
601
602func TestParseQueryWithVarValDotProduct(t *testing.T) {
603 query := `

Callers

nothing calls this directly

Calls 2

ParseFunction · 0.70
debugStringMethod · 0.45

Tested by

no test coverage detected