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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « service/datastore/properties.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: service/datastore/properties_test.go
diff --git a/service/datastore/properties_test.go b/service/datastore/properties_test.go
index be47cae1a14173c2125cac30311df4729287bbc6..581b1f6a5f5cbdbb7f7d554812326f9913b43281 100644
--- a/service/datastore/properties_test.go
+++ b/service/datastore/properties_test.go
@@ -51,6 +51,27 @@ func TestProperties(t *testing.T) {
So(pv.IndexSetting(), ShouldEqual, ShouldIndex)
So(pv.Type().String(), ShouldEqual, "PTInt")
})
+ Convey("int32", func() {
+ pv := MkProperty(int32(32))
+ So(pv.Value(), ShouldHaveSameTypeAs, int64(32))
+ So(pv.Value(), ShouldEqual, 32)
+ So(pv.IndexSetting(), ShouldEqual, ShouldIndex)
+ So(pv.Type().String(), ShouldEqual, "PTInt")
+ })
+ Convey("uint32", func() {
+ pv := MkProperty(uint32(32))
+ So(pv.Value(), ShouldHaveSameTypeAs, int64(32))
+ So(pv.Value(), ShouldEqual, 32)
+ So(pv.IndexSetting(), ShouldEqual, ShouldIndex)
+ So(pv.Type().String(), ShouldEqual, "PTInt")
+ })
+ Convey("byte", func() {
+ pv := MkProperty(byte(32))
+ So(pv.Value(), ShouldHaveSameTypeAs, int64(32))
+ So(pv.Value(), ShouldEqual, 32)
+ So(pv.IndexSetting(), ShouldEqual, ShouldIndex)
+ So(pv.Type().String(), ShouldEqual, "PTInt")
+ })
Convey("bool (true)", func() {
pv := MkProperty(mybool(true))
So(pv.Value(), ShouldBeTrue)
« 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