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

Function TestParseQueryWithVarValDotProduct

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

Source from the content-addressed store, hash-verified

600}
601
602func TestParseQueryWithVarValDotProduct(t *testing.T) {
603 query := `
604 {
605 me(func: uid(L), orderasc: val(d) ) {
606 name
607 }
608
609 var(func: uid(0x0a)) {
610 L as friends {
611 a as vfloat
612 b as vfloat
613 c as count(relatives)
614 d as math(a dot b * c)
615 }
616 }
617 }
618`
619 res, err := Parse(Request{Str: query})
620 require.NoError(t, err)
621 require.EqualValues(t, "(dot a (* b c))",
622 res.Query[1].Children[0].Children[3].MathExp.debugString())
623}
624
625func TestParseQueryWithVarValDotProduct2(t *testing.T) {
626 query := `

Callers

nothing calls this directly

Calls 2

ParseFunction · 0.70
debugStringMethod · 0.45

Tested by

no test coverage detected