Add tests for delete/deleteall

This commit is contained in:
Patrick O'brien 2016-09-20 16:55:36 +10:00
parent a753d91ace
commit d3f15c1953

View file

@ -63,19 +63,19 @@ func TestBuildQuery(t *testing.T) {
delete: true, delete: true,
from: []string{"thing happy", `upset as "sad"`, "fun", "thing as stuff", `"angry" as mad`}, from: []string{"thing happy", `upset as "sad"`, "fun", "thing as stuff", `"angry" as mad`},
where: []where{ where: []where{
{clause: "a=?", args: []interface{}{}}, {clause: "a=?", args: []interface{}{1}},
{clause: "b=?", args: []interface{}{}}, {clause: "b=?", args: []interface{}{2}},
{clause: "c=?", args: []interface{}{}}, {clause: "c=?", args: []interface{}{3}},
}, },
}, nil}, }, []interface{}{1, 2, 3}},
{&Query{ {&Query{
delete: true, delete: true,
from: []string{"thing happy", `upset as "sad"`, "fun", "thing as stuff", `"angry" as mad`}, from: []string{"thing happy", `upset as "sad"`, "fun", "thing as stuff", `"angry" as mad`},
where: []where{ where: []where{
{clause: "(id=? and thing=?) or stuff=?", args: []interface{}{}}, {clause: "(id=? and thing=?) or stuff=?", args: []interface{}{1, 2, 3}},
}, },
limit: 5, limit: 5,
}, nil}, }, []interface{}{1, 2, 3}},
{&Query{ {&Query{
from: []string{"thing happy", `"fun"`, `stuff`}, from: []string{"thing happy", `"fun"`, `stuff`},
update: map[string]interface{}{ update: map[string]interface{}{