Skip to content

Commit

Permalink
Improve server test.
Browse files Browse the repository at this point in the history
  • Loading branch information
moriyoshi committed Apr 3, 2011
1 parent c01b1bb commit 8a3d2ff
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions go/rpc/server_test.go
Expand Up @@ -33,15 +33,16 @@ func TestRun(t *testing.T) {
return
}
client := NewSession(conn, true)
retval, xerr := client.Send("echo", "test")
if xerr != nil {
t.Error(xerr.String())
return
}
_retval, ok := retval.(*reflect.StringValue)
if !ok {
return
for _, v := range []string { "world", "test", "hey" } {
retval, xerr := client.Send("echo", v)
if xerr != nil {
t.Error(xerr.String())
return
}
_retval, ok := retval.(*reflect.StringValue)
if !ok {
return
}
if _retval.Get() != "Hello, " + v { t.Error("retval != \"Hello, " + v + "\"") }
}
if _retval.Get() != "Hello, test" { t.Error("retval != \"Hello, test\"") }

}

0 comments on commit 8a3d2ff

Please sign in to comment.