(t *testing.T)
| 502 | } |
| 503 | |
| 504 | func TestParseQueryWithVarValAggNested2(t *testing.T) { |
| 505 | query := ` |
| 506 | { |
| 507 | me(func: uid(L), orderasc: val(d)) { |
| 508 | name |
| 509 | val(q) |
| 510 | } |
| 511 | |
| 512 | var(func: uid(0x0a)) { |
| 513 | L as friends { |
| 514 | a as age |
| 515 | b as count(friends) |
| 516 | c as count(relatives) |
| 517 | d as math(exp(a + b + 1.0) - ln(c)) |
| 518 | q as math(c*-1.0+-b+(-b*c)) |
| 519 | } |
| 520 | } |
| 521 | } |
| 522 | ` |
| 523 | res, err := Parse(Request{Str: query}) |
| 524 | require.NoError(t, err) |
| 525 | require.EqualValues(t, "(- (exp (+ (+ a b) 1E+00)) (ln c))", |
| 526 | res.Query[1].Children[0].Children[3].MathExp.debugString()) |
| 527 | require.EqualValues(t, "(+ (+ (* c (u- 1E+00)) (u- b)) (* (u- b) c))", |
| 528 | res.Query[1].Children[0].Children[4].MathExp.debugString()) |
| 529 | } |
| 530 | |
| 531 | func TestParseQueryWithVarValAggNested4(t *testing.T) { |
| 532 | query := ` |
nothing calls this directly
no test coverage detected