| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 So(pv.Type().String(), ShouldEqual, "PTNull") | 44 So(pv.Type().String(), ShouldEqual, "PTNull") |
| 45 }) | 45 }) |
| 46 Convey("derived types", func() { | 46 Convey("derived types", func() { |
| 47 Convey("int", func() { | 47 Convey("int", func() { |
| 48 pv := MkProperty(19) | 48 pv := MkProperty(19) |
| 49 So(pv.Value(), ShouldHaveSameTypeAs, int
64(19)) | 49 So(pv.Value(), ShouldHaveSameTypeAs, int
64(19)) |
| 50 So(pv.Value(), ShouldEqual, 19) | 50 So(pv.Value(), ShouldEqual, 19) |
| 51 So(pv.IndexSetting(), ShouldEqual, Shoul
dIndex) | 51 So(pv.IndexSetting(), ShouldEqual, Shoul
dIndex) |
| 52 So(pv.Type().String(), ShouldEqual, "PTI
nt") | 52 So(pv.Type().String(), ShouldEqual, "PTI
nt") |
| 53 }) | 53 }) |
| 54 Convey("int32", func() { |
| 55 pv := MkProperty(int32(32)) |
| 56 So(pv.Value(), ShouldHaveSameTypeAs, int
64(32)) |
| 57 So(pv.Value(), ShouldEqual, 32) |
| 58 So(pv.IndexSetting(), ShouldEqual, Shoul
dIndex) |
| 59 So(pv.Type().String(), ShouldEqual, "PTI
nt") |
| 60 }) |
| 61 Convey("uint32", func() { |
| 62 pv := MkProperty(uint32(32)) |
| 63 So(pv.Value(), ShouldHaveSameTypeAs, int
64(32)) |
| 64 So(pv.Value(), ShouldEqual, 32) |
| 65 So(pv.IndexSetting(), ShouldEqual, Shoul
dIndex) |
| 66 So(pv.Type().String(), ShouldEqual, "PTI
nt") |
| 67 }) |
| 68 Convey("byte", func() { |
| 69 pv := MkProperty(byte(32)) |
| 70 So(pv.Value(), ShouldHaveSameTypeAs, int
64(32)) |
| 71 So(pv.Value(), ShouldEqual, 32) |
| 72 So(pv.IndexSetting(), ShouldEqual, Shoul
dIndex) |
| 73 So(pv.Type().String(), ShouldEqual, "PTI
nt") |
| 74 }) |
| 54 Convey("bool (true)", func() { | 75 Convey("bool (true)", func() { |
| 55 pv := MkProperty(mybool(true)) | 76 pv := MkProperty(mybool(true)) |
| 56 So(pv.Value(), ShouldBeTrue) | 77 So(pv.Value(), ShouldBeTrue) |
| 57 So(pv.IndexSetting(), ShouldEqual, Shoul
dIndex) | 78 So(pv.IndexSetting(), ShouldEqual, Shoul
dIndex) |
| 58 So(pv.Type().String(), ShouldEqual, "PTB
ool") | 79 So(pv.Type().String(), ShouldEqual, "PTB
ool") |
| 59 }) | 80 }) |
| 60 Convey("string", func() { | 81 Convey("string", func() { |
| 61 pv := MkProperty(mystring("sup")) | 82 pv := MkProperty(mystring("sup")) |
| 62 So(pv.Value(), ShouldEqual, "sup") | 83 So(pv.Value(), ShouldEqual, "sup") |
| 63 So(pv.IndexSetting(), ShouldEqual, Shoul
dIndex) | 84 So(pv.IndexSetting(), ShouldEqual, Shoul
dIndex) |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 cmpBS, _ := c.co
nv(tc.cmpS) | 309 cmpBS, _ := c.co
nv(tc.cmpS) |
| 289 So(cmpByteSequen
ce(bs, cmpBS), tc.assertion, 0) | 310 So(cmpByteSequen
ce(bs, cmpBS), tc.assertion, 0) |
| 290 }) | 311 }) |
| 291 } | 312 } |
| 292 } | 313 } |
| 293 }) | 314 }) |
| 294 } | 315 } |
| 295 } | 316 } |
| 296 }) | 317 }) |
| 297 } | 318 } |
| OLD | NEW |