Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(304)

Side by Side Diff: service/datastore/properties_test.go

Issue 1667403003: Add support for uint8, uint16 and uint32 in luci/gae (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: allow negative Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « service/datastore/properties.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « service/datastore/properties.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698