| 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 "fmt" | 8 "fmt" |
| 9 "math" | 9 "math" |
| 10 "sort" | 10 "sort" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 So(pv.IndexSetting(), ShouldEqual, Shoul
dIndex) | 84 So(pv.IndexSetting(), ShouldEqual, Shoul
dIndex) |
| 85 So(pv.Type().String(), ShouldEqual, "PTS
tring") | 85 So(pv.Type().String(), ShouldEqual, "PTS
tring") |
| 86 }) | 86 }) |
| 87 Convey("blobstore.Key is distinquished", func()
{ | 87 Convey("blobstore.Key is distinquished", func()
{ |
| 88 pv := MkProperty(blobstore.Key("sup")) | 88 pv := MkProperty(blobstore.Key("sup")) |
| 89 So(pv.Value(), ShouldEqual, blobstore.Ke
y("sup")) | 89 So(pv.Value(), ShouldEqual, blobstore.Ke
y("sup")) |
| 90 So(pv.IndexSetting(), ShouldEqual, Shoul
dIndex) | 90 So(pv.IndexSetting(), ShouldEqual, Shoul
dIndex) |
| 91 So(pv.Type().String(), ShouldEqual, "PTB
lobKey") | 91 So(pv.Type().String(), ShouldEqual, "PTB
lobKey") |
| 92 }) | 92 }) |
| 93 Convey("datastore Key is distinguished", func()
{ | 93 Convey("datastore Key is distinguished", func()
{ |
| 94 » » » » » k := MakeKey("appid", "ns", "kind", "1") | 94 » » » » » k := KeyContext{"appid", "ns"}.MakeKey("
kind", "1") |
| 95 pv := MkProperty(k) | 95 pv := MkProperty(k) |
| 96 So(pv.Value(), ShouldHaveSameTypeAs, k) | 96 So(pv.Value(), ShouldHaveSameTypeAs, k) |
| 97 So(pv.Value().(*Key).Equal(k), ShouldBeT
rue) | 97 So(pv.Value().(*Key).Equal(k), ShouldBeT
rue) |
| 98 So(pv.IndexSetting(), ShouldEqual, Shoul
dIndex) | 98 So(pv.IndexSetting(), ShouldEqual, Shoul
dIndex) |
| 99 So(pv.Type().String(), ShouldEqual, "PTK
ey") | 99 So(pv.Type().String(), ShouldEqual, "PTK
ey") |
| 100 | 100 |
| 101 pv = MkProperty((*Key)(nil)) | 101 pv = MkProperty((*Key)(nil)) |
| 102 So(pv.Value(), ShouldBeNil) | 102 So(pv.Value(), ShouldBeNil) |
| 103 So(pv.IndexSetting(), ShouldEqual, Shoul
dIndex) | 103 So(pv.IndexSetting(), ShouldEqual, Shoul
dIndex) |
| 104 So(pv.Type().String(), ShouldEqual, "PTN
ull") | 104 So(pv.Type().String(), ShouldEqual, "PTN
ull") |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 cmpBS, _ := c.co
nv(tc.cmpS) | 309 cmpBS, _ := c.co
nv(tc.cmpS) |
| 310 So(cmpByteSequen
ce(bs, cmpBS), tc.assertion, 0) | 310 So(cmpByteSequen
ce(bs, cmpBS), tc.assertion, 0) |
| 311 }) | 311 }) |
| 312 } | 312 } |
| 313 } | 313 } |
| 314 }) | 314 }) |
| 315 } | 315 } |
| 316 } | 316 } |
| 317 }) | 317 }) |
| 318 } | 318 } |
| OLD | NEW |