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

Side by Side Diff: logdog/client/butler/output/pubsub/pubsubOutput_test.go

Issue 2355203002: Rename Topic's Name method to String. (Closed)
Patch Set: Created 4 years, 3 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 | « logdog/client/butler/output/pubsub/pubsubOutput.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 pubsub 5 package pubsub
6 6
7 import ( 7 import (
8 "bytes" 8 "bytes"
9 "compress/zlib" 9 "compress/zlib"
10 "errors" 10 "errors"
(...skipping 17 matching lines...) Expand all
28 28
29 type testTopic struct { 29 type testTopic struct {
30 sync.Mutex 30 sync.Mutex
31 31
32 err error 32 err error
33 33
34 msgC chan *pubsub.Message 34 msgC chan *pubsub.Message
35 nextMessageID int 35 nextMessageID int
36 } 36 }
37 37
38 func (t *testTopic) Name() string { return "test" } 38 func (t *testTopic) String() string { return "test" }
39 39
40 func (t *testTopic) Publish(c context.Context, msgs ...*pubsub.Message) ([]strin g, error) { 40 func (t *testTopic) Publish(c context.Context, msgs ...*pubsub.Message) ([]strin g, error) {
41 if t.err != nil { 41 if t.err != nil {
42 return nil, t.err 42 return nil, t.err
43 } 43 }
44 44
45 ids := make([]string, len(msgs)) 45 ids := make([]string, len(msgs))
46 for i, m := range msgs { 46 for i, m := range msgs {
47 t.msgC <- m 47 t.msgC <- m
48 ids[i] = t.getNextMessageID() 48 ids[i] = t.getNextMessageID()
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 So(st.DiscardedMessages(), ShouldEqual, 0) 141 So(st.DiscardedMessages(), ShouldEqual, 0)
142 }) 142 })
143 }) 143 })
144 144
145 Convey(`Will return an error if Publish failed.`, func() { 145 Convey(`Will return an error if Publish failed.`, func() {
146 tt.err = errors.New("test: error") 146 tt.err = errors.New("test: error")
147 So(o.SendBundle(bundle), ShouldNotBeNil) 147 So(o.SendBundle(bundle), ShouldNotBeNil)
148 }) 148 })
149 }) 149 })
150 } 150 }
OLDNEW
« no previous file with comments | « logdog/client/butler/output/pubsub/pubsubOutput.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698