Index: service/datastore/index_test.go |
diff --git a/service/datastore/index_test.go b/service/datastore/index_test.go |
index 2667534c791f2401fe334f5ba0427824d042c36e..6d910e649321cc2c079ac7dc6884359287aa7788 100644 |
--- a/service/datastore/index_test.go |
+++ b/service/datastore/index_test.go |
@@ -7,7 +7,6 @@ |
package datastore |
import ( |
- "bytes" |
"testing" |
. "github.com/smartystreets/goconvey/convey" |
@@ -41,52 +40,5 @@ func TestIndexDefinition(t *testing.T) { |
So(id.Builtin(), ShouldBeFalse) |
So(id.Compound(), ShouldBeFalse) |
}) |
- |
- Convey("binary", func() { |
- id := IndexDefinition{Kind: "kind"} |
- buf := &bytes.Buffer{} |
- So(id.Write(buf), ShouldBeNil) |
- So(bytes.HasPrefix(buf.Bytes(), IndexBuiltinQueryPrefix()), ShouldBeTrue) |
- newId := IndexDefinition{} |
- So(newId.Read(buf), ShouldBeNil) |
- So(newId, ShouldResemble, id) |
- |
- id.SortBy = append(id.SortBy, IndexColumn{Property: "prop"}) |
- buf = &bytes.Buffer{} |
- So(id.Write(buf), ShouldBeNil) |
- So(bytes.HasPrefix(buf.Bytes(), IndexBuiltinQueryPrefix()), ShouldBeTrue) |
- newId = IndexDefinition{} |
- So(newId.Read(buf), ShouldBeNil) |
- So(newId, ShouldResemble, id) |
- |
- id.SortBy = append(id.SortBy, IndexColumn{"other", DESCENDING}) |
- id.Ancestor = true |
- buf = &bytes.Buffer{} |
- So(id.Write(buf), ShouldBeNil) |
- So(bytes.HasPrefix(buf.Bytes(), IndexComplexQueryPrefix()), ShouldBeTrue) |
- newId = IndexDefinition{} |
- So(newId.Read(buf), ShouldBeNil) |
- So(newId, ShouldResemble, id) |
- |
- // invalid |
- id.SortBy = append(id.SortBy, IndexColumn{"", DESCENDING}) |
- buf = &bytes.Buffer{} |
- So(id.Write(buf), ShouldBeNil) |
- So(bytes.HasPrefix(buf.Bytes(), IndexComplexQueryPrefix()), ShouldBeTrue) |
- newId = IndexDefinition{} |
- So(newId.Read(buf), ShouldBeNil) |
- So(newId, ShouldResemble, id) |
- }) |
- |
- Convey("too many", func() { |
- id := IndexDefinition{Kind: "wat"} |
- for i := 0; i < MaxIndexColumns+1; i++ { |
- id.SortBy = append(id.SortBy, IndexColumn{"Hi", ASCENDING}) |
- } |
- buf := &bytes.Buffer{} |
- So(id.Write(buf), ShouldBeNil) |
- newId := IndexDefinition{} |
- So(newId.Read(buf).Error(), ShouldContainSubstring, "over 64 sort orders") |
- }) |
}) |
} |