| OLD | NEW |
| 1 // Copyright 2015 The LUCI Authors. All rights reserved. | 1 // Copyright 2015 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
| 4 | 4 |
| 5 package datastore | 5 package datastore |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "testing" | 8 "testing" |
| 9 | 9 |
| 10 "github.com/luci/gae/service/info" | 10 "github.com/luci/gae/service/info" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 Convey("without adding anything", func() { | 42 Convey("without adding anything", func() { |
| 43 So(Raw(c), ShouldBeNil) | 43 So(Raw(c), ShouldBeNil) |
| 44 }) | 44 }) |
| 45 | 45 |
| 46 Convey("adding a basic implementation", func() { | 46 Convey("adding a basic implementation", func() { |
| 47 c = SetRaw(info.Set(c, fakeInfo{}), fakeService{}) | 47 c = SetRaw(info.Set(c, fakeInfo{}), fakeService{}) |
| 48 | 48 |
| 49 Convey("lets you pull them back out", func() { | 49 Convey("lets you pull them back out", func() { |
| 50 So(Raw(c), ShouldResemble, &checkFilter{ | 50 So(Raw(c), ShouldResemble, &checkFilter{ |
| 51 RawInterface: fakeService{}, | 51 RawInterface: fakeService{}, |
| 52 » » » » » kc: KeyContext{"s~aid", "ns"}, | 52 » » » » » kc: MkKeyContext("s~aid", "ns"
), |
| 53 }) | 53 }) |
| 54 }) | 54 }) |
| 55 | 55 |
| 56 Convey("and lets you add filters", func() { | 56 Convey("and lets you add filters", func() { |
| 57 c = AddRawFilters(c, func(ic context.Context, rd
s RawInterface) RawInterface { | 57 c = AddRawFilters(c, func(ic context.Context, rd
s RawInterface) RawInterface { |
| 58 return fakeFilt{rds} | 58 return fakeFilt{rds} |
| 59 }) | 59 }) |
| 60 | 60 |
| 61 curs, err := DecodeCursor(c, "pants") | 61 curs, err := DecodeCursor(c, "pants") |
| 62 So(err, ShouldBeNil) | 62 So(err, ShouldBeNil) |
| 63 So(curs.String(), ShouldEqual, "pants") | 63 So(curs.String(), ShouldEqual, "pants") |
| 64 }) | 64 }) |
| 65 }) | 65 }) |
| 66 Convey("adding zero filters does nothing", func() { | 66 Convey("adding zero filters does nothing", func() { |
| 67 So(AddRawFilters(c), ShouldEqual, c) | 67 So(AddRawFilters(c), ShouldEqual, c) |
| 68 }) | 68 }) |
| 69 }) | 69 }) |
| 70 } | 70 } |
| OLD | NEW |