(t *testing.T)
| 575 | } |
| 576 | |
| 577 | func 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 | |
| 602 | func TestParseQueryWithVarValDotProduct(t *testing.T) { |
| 603 | query := ` |
nothing calls this directly
no test coverage detected