| 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 memory | 5 package memory |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "bytes" | 8 "bytes" |
| 9 "fmt" | 9 "fmt" |
| 10 "infra/gae/libs/wrapper" | 10 "infra/gae/libs/wrapper" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 c, err := wrapper.GetGI(c).Namespace("bobspace") | 35 c, err := wrapper.GetGI(c).Namespace("bobspace") |
| 36 So(err, ShouldBeNil) | 36 So(err, ShouldBeNil) |
| 37 ds := wrapper.GetDS(c) | 37 ds := wrapper.GetDS(c) |
| 38 | 38 |
| 39 k := ds.NewKey("Bunny", "", 10, ds.NewKey("Parent", "Cat", 0, ni
l)) | 39 k := ds.NewKey("Bunny", "", 10, ds.NewKey("Parent", "Cat", 0, ni
l)) |
| 40 So(k.Namespace(), ShouldEqual, "bobspace") | 40 So(k.Namespace(), ShouldEqual, "bobspace") |
| 41 | 41 |
| 42 b := &bytes.Buffer{} | 42 b := &bytes.Buffer{} |
| 43 writeKey(b, withNS, k) | 43 writeKey(b, withNS, k) |
| 44 | 44 |
| 45 » » newk, err := readKey(b, withNS) | 45 » » newk, err := readKey(b, withNS, "") |
| 46 So(err, ShouldBeNil) | 46 So(err, ShouldBeNil) |
| 47 So(k.Namespace(), ShouldEqual, "bobspace") | 47 So(k.Namespace(), ShouldEqual, "bobspace") |
| 48 So(newk, shouldEqualKey, k) | 48 So(newk, shouldEqualKey, k) |
| 49 So(b.Bytes(), ShouldBeEmpty) | 49 So(b.Bytes(), ShouldBeEmpty) |
| 50 }) | 50 }) |
| 51 } | 51 } |
| OLD | NEW |