FAQ
Reviewers: golang-dev_googlegroups.com,

Message:
Hello golang-dev@googlegroups.com,

I'd like you to review this change to
https://go.googlecode.com/hg/


Description:
net/rpc/jsonrpc: fix test error message

Fixes issue 4041.

Please review this at http://codereview.appspot.com/6495121/

Affected files:
M src/pkg/net/rpc/jsonrpc/all_test.go


Index: src/pkg/net/rpc/jsonrpc/all_test.go
===================================================================
--- a/src/pkg/net/rpc/jsonrpc/all_test.go
+++ b/src/pkg/net/rpc/jsonrpc/all_test.go
@@ -127,11 +127,11 @@
args := &Args{7, 8}
reply := new(Reply)
err := client.Call("Arith.Add", args, reply)
- if err != nil {
+ if err != nil || reply.C != args.A+args.B {
t.Errorf("Add: expected no error but got string %q", err.Error())
}
if reply.C != args.A+args.B {
- t.Errorf("Add: expected %d got %d", reply.C, args.A+args.B)
+ t.Errorf("Add: got %d expected %d", reply.C, args.A+args.B)
}

args = &Args{7, 8}
@@ -141,7 +141,7 @@
t.Errorf("Mul: expected no error but got string %q", err.Error())
}
if reply.C != args.A*args.B {
- t.Errorf("Mul: expected %d got %d", reply.C, args.A*args.B)
+ t.Errorf("Mul: got %d expected %d", reply.C, args.A*args.B)
}

// Out of order.
@@ -156,7 +156,7 @@
t.Errorf("Add: expected no error but got string %q",
addCall.Error.Error())
}
if addReply.C != args.A+args.B {
- t.Errorf("Add: expected %d got %d", addReply.C, args.A+args.B)
+ t.Errorf("Add: got %d expected %d", addReply.C, args.A+args.B)
}

mulCall = <-mulCall.Done
@@ -164,7 +164,7 @@
t.Errorf("Mul: expected no error but got string %q",
mulCall.Error.Error())
}
if mulReply.C != args.A*args.B {
- t.Errorf("Mul: expected %d got %d", mulReply.C, args.A*args.B)
+ t.Errorf("Mul: got %d expected %d", mulReply.C, args.A*args.B)
}

// Error test

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedSep 12, '12 at 9:28p
activeSep 12, '12 at 9:37p
posts3
users2
websitegolang.org

2 users in discussion

Rsc: 2 posts Bradfitz: 1 post

People

Translate

site design / logo © 2022 Grokbase