made test not panic

This commit is contained in:
Todd Gruben 2014-07-23 10:21:50 -05:00
parent 4eae5300fb
commit eeaff874ee

View file

@ -1,6 +1,7 @@
package query
import (
"log"
"pilosa/db"
"pilosa/util"
"testing"
@ -50,10 +51,12 @@ func TestQueryPlanner(t *testing.T) {
destination := fragment1.GetLocation()
id := util.RandomUUID()
log.Println(id)
qpp, err := qplanner.Plan(&query, &id, destination)
So(err, ShouldEqual, nil)
qp := *qpp
So(err, ShouldEqual, nil)
So(len(qp), ShouldEqual, 7)
So(qp[0].(GetQueryStep).Operation, ShouldEqual, "get")
So(qp[0].(GetQueryStep).Slice, ShouldEqual, 0)
@ -95,8 +98,8 @@ func TestQueryPlanner(t *testing.T) {
id := util.RandomUUID()
qpp, err := qplanner.Plan(query, &id, destination)
qp := *qpp
So(err, ShouldEqual, nil)
qp := *qpp
So(len(qp), ShouldEqual, 3)
So(qp[0].(GetQueryStep).Operation, ShouldEqual, "get")
@ -123,8 +126,8 @@ func TestQueryPlanner(t *testing.T) {
id := util.RandomUUID()
qpp, err := qplanner.Plan(query, &id, destination)
qp := *qpp
So(err, ShouldEqual, nil)
qp := *qpp
So(len(qp), ShouldEqual, 7)
So(qp[0].(GetQueryStep).Operation, ShouldEqual, "get")
@ -166,8 +169,8 @@ func TestQueryPlanner(t *testing.T) {
id := util.RandomUUID()
qpp, err := qplanner.Plan(query, &id, destination)
qp := *qpp
So(err, ShouldEqual, nil)
qp := *qpp
So(len(qp), ShouldEqual, 1)
So(qp[0].(SetQueryStep).Operation, ShouldEqual, "set")
So(qp[0].(SetQueryStep).ProfileId, ShouldEqual, 100)
@ -184,6 +187,7 @@ func TestQueryPlanner(t *testing.T) {
id := util.RandomUUID()
qpp, err := qplanner.Plan(query, &id, destination)
So(err, ShouldEqual, nil)
qp := *qpp
So(err, ShouldEqual, nil)
So(len(qp), ShouldEqual, 5)