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 // adapted from github.com/golang/appengine/datastore | 5 // adapted from github.com/golang/appengine/datastore |
6 | 6 |
7 package datastore | 7 package datastore |
8 | 8 |
9 import ( | 9 import ( |
10 "bytes" | 10 "bytes" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 func makeUint8Slice(n int) []uint8 { | 54 func makeUint8Slice(n int) []uint8 { |
55 b := make([]uint8, n) | 55 b := make([]uint8, n) |
56 for i := range b { | 56 for i := range b { |
57 b[i] = uint8(i) | 57 b[i] = uint8(i) |
58 } | 58 } |
59 return b | 59 return b |
60 } | 60 } |
61 | 61 |
62 var ( | 62 var ( |
63 » testKey0 = mkKey("aid", "", "kind", "name0") | 63 » testKey0 = mkKey("kind", "name0") |
64 » testKey1a = mkKey("aid", "", "kind", "name1") | 64 » testKey1a = mkKey("kind", "name1") |
65 » testKey1b = mkKey("aid", "", "kind", "name1") | 65 » testKey1b = mkKey("kind", "name1") |
66 » testKey2a = mkKey("aid", "", "kind", "name0", "kind", "name2") | 66 » testKey2a = mkKey("kind", "name0", "kind", "name2") |
67 » testKey2b = mkKey("aid", "", "kind", "name0", "kind", "name2") | 67 » testKey2b = mkKey("kind", "name0", "kind", "name2") |
68 testGeoPt0 = GeoPoint{Lat: 1.2, Lng: 3.4} | 68 testGeoPt0 = GeoPoint{Lat: 1.2, Lng: 3.4} |
69 testGeoPt1 = GeoPoint{Lat: 5, Lng: 10} | 69 testGeoPt1 = GeoPoint{Lat: 5, Lng: 10} |
70 testBadGeoPt = GeoPoint{Lat: 1000, Lng: 34} | 70 testBadGeoPt = GeoPoint{Lat: 1000, Lng: 34} |
71 ) | 71 ) |
72 | 72 |
73 type B0 struct { | 73 type B0 struct { |
74 B []byte `gae:",noindex"` | 74 B []byte `gae:",noindex"` |
75 } | 75 } |
76 | 76 |
77 type B1 struct { | 77 type B1 struct { |
(...skipping 1866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1944 So(pls.SetMeta("id", "sup|1337"), ShouldBeTrue) | 1944 So(pls.SetMeta("id", "sup|1337"), ShouldBeTrue) |
1945 So(ide.EmbeddedID, ShouldResemble, EmbeddedID{"sup", 133
7}) | 1945 So(ide.EmbeddedID, ShouldResemble, EmbeddedID{"sup", 133
7}) |
1946 | 1946 |
1947 So(pls.GetAllMeta(), ShouldResembleV, PropertyMap{ | 1947 So(pls.GetAllMeta(), ShouldResembleV, PropertyMap{ |
1948 "$id": {mpNI("sup|1337")}, | 1948 "$id": {mpNI("sup|1337")}, |
1949 "$kind": {mpNI("IDEmbedder")}, | 1949 "$kind": {mpNI("IDEmbedder")}, |
1950 }) | 1950 }) |
1951 }) | 1951 }) |
1952 }) | 1952 }) |
1953 } | 1953 } |
OLD | NEW |