mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 17:15:56 +00:00
Merge pull request #165 from travisturner/range-ast-fix
fix Call stringer for range conditional
This commit is contained in:
commit
93a804f7ab
3 changed files with 4 additions and 5 deletions
|
|
@ -729,7 +729,7 @@ func (c *Call) String() string {
|
|||
// the equal sign in the string representation.
|
||||
switch v := c.Args[key].(type) {
|
||||
case *Condition:
|
||||
fmt.Fprintf(&buf, "%v %s", key, v.String())
|
||||
fmt.Fprintf(&buf, "%s", v.StringWithSubj(key))
|
||||
default:
|
||||
fmt.Fprintf(&buf, "%v=%s", key, formatValue(v))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ func TestCall_String(t *testing.T) {
|
|||
"field0": &pql.Condition{Op: pql.GTE, Value: 10},
|
||||
},
|
||||
}
|
||||
if s := c.String(); s != `Range(field0 >= 10, other="f")` {
|
||||
if s := c.String(); s != `Range(field0>= 10, other="f")` {
|
||||
t.Fatalf("unexpected string: %s", s)
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ SetBit(Union(Zitmap(row==4), Intersect(Qitmap(blah>4), Ritmap(field="http://zoo9
|
|||
if err != nil {
|
||||
t.Fatalf("should have parsed: %v", err)
|
||||
}
|
||||
if q.String() != `TopN(Bitmap(id == "other"), _field="blah", field="f", n=0)` {
|
||||
if q.String() != `TopN(Bitmap(id== "other"), _field="blah", field="f", n=0)` {
|
||||
t.Fatalf("Failed, got: %s", q)
|
||||
}
|
||||
|
||||
|
|
@ -55,8 +55,7 @@ SetBit(Union(Zitmap(row==4), Intersect(Qitmap(blah>4), Ritmap(field="http://zoo9
|
|||
if err != nil {
|
||||
t.Fatalf("should have parsed: %v", err)
|
||||
}
|
||||
|
||||
if q.String() != `Bitmap(did == "other", row=4)` {
|
||||
if q.String() != `Bitmap(did== "other", row=4)` {
|
||||
t.Fatalf("got %s", q)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue