(t *testing.T)
| 479 | require.Contains(t, err.Error(), "Empty () not allowed in math block") |
| 480 | } |
| 481 | func 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 | |
| 504 | func TestParseQueryWithVarValAggNested2(t *testing.T) { |
| 505 | query := ` |
nothing calls this directly
no test coverage detected