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

Side by Side Diff: service/datastore/serialize/serialize_test.go

Issue 2569923002: Split Buffer into WriteBuffer/ReadBuffer. (Closed)
Patch Set: Created 4 years 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/serialize/serialize.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 LUCI Authors. All rights reserved. 1 // Copyright 2015 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package serialize 5 package serialize
6 6
7 import ( 7 import (
8 "bytes" 8 "bytes"
9 "fmt" 9 "fmt"
10 "io" 10 "io"
(...skipping 19 matching lines...) Expand all
30 30
31 type dspmapTC struct { 31 type dspmapTC struct {
32 name string 32 name string
33 props ds.PropertyMap 33 props ds.PropertyMap
34 } 34 }
35 35
36 func mkKey(appID, namespace string, elems ...interface{}) *ds.Key { 36 func mkKey(appID, namespace string, elems ...interface{}) *ds.Key {
37 return ds.MkKeyContext(appID, namespace).MakeKey(elems...) 37 return ds.MkKeyContext(appID, namespace).MakeKey(elems...)
38 } 38 }
39 39
40 func mkBuf(data []byte) Buffer { 40 func mkBuf(data []byte) WriteBuffer {
41 return Invertible(bytes.NewBuffer(data)) 41 return Invertible(bytes.NewBuffer(data))
42 } 42 }
43 43
44 // TODO(riannucci): dedup with datastore/key testing file 44 // TODO(riannucci): dedup with datastore/key testing file
45 func ShouldEqualKey(actual interface{}, expected ...interface{}) string { 45 func ShouldEqualKey(actual interface{}, expected ...interface{}) string {
46 if len(expected) != 1 { 46 if len(expected) != 1 {
47 return fmt.Sprintf("Assertion requires 1 expected value, got %d" , len(expected)) 47 return fmt.Sprintf("Assertion requires 1 expected value, got %d" , len(expected))
48 } 48 }
49 if actual.(*ds.Key).Equal(expected[0].(*ds.Key)) { 49 if actual.(*ds.Key).Equal(expected[0].(*ds.Key)) {
50 return "" 50 return ""
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 "__ancestor__": { 509 "__ancestor__": {
510 ToBytes(mp(fakeKey)), 510 ToBytes(mp(fakeKey)),
511 ToBytes(mp(fakeKey.Paren t())), 511 ToBytes(mp(fakeKey.Paren t())),
512 }, 512 },
513 }) 513 })
514 }) 514 })
515 }) 515 })
516 }) 516 })
517 }) 517 })
518 } 518 }
OLDNEW
« no previous file with comments | « service/datastore/serialize/serialize.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698