(t *testing.T)
| 41 | } |
| 42 | |
| 43 | func TestExprRoundTrip(t *testing.T) { |
| 44 | t.Parallel() |
| 45 | for _, et := range exprTests { |
| 46 | exp, err := expr.ParseExpression(et.qlText) |
| 47 | if et.ok { |
| 48 | assert.Equal(t, err, nil, "Should not error parse expr but got %v for %s", err, et.qlText) |
| 49 | by, err := json.MarshalIndent(exp.Expr(), "", " ") |
| 50 | assert.Equal(t, err, nil) |
| 51 | u.Debugf("%s", string(by)) |
| 52 | en := &expr.Expr{} |
| 53 | err = json.Unmarshal(by, en) |
| 54 | assert.Equal(t, err, nil) |
| 55 | _, err = expr.NodeFromExpr(en) |
| 56 | assert.Equal(t, err, nil, et.qlText) |
| 57 | |
| 58 | // by, _ = json.MarshalIndent(nn.Expr(), "", " ") |
| 59 | // u.Debugf("%s", string(by)) |
| 60 | |
| 61 | // TODO: Fixme |
| 62 | // u.Debugf("%s", nn) |
| 63 | //assert.True(t, nn.Equal(exp), "%s doesn't match %s", et.qlText, nn.String()) |
| 64 | |
| 65 | } else { |
| 66 | assert.NotEqual(t, nil, err) |
| 67 | } |
| 68 | |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | func TestNodeJson(t *testing.T) { |
| 73 | t.Parallel() |
nothing calls this directly
no test coverage detected