update statuscode
This commit is contained in:
@@ -9,8 +9,11 @@ func TestGenericConnection(t *testing.T) {
|
||||
t.Errorf("Error listening: %v\n", err)
|
||||
}
|
||||
datta := []byte("Hello, world!")
|
||||
listener.AddHandler(Ping, func(input *FrameWithPayload, resultChan chan<- FrameWithPayload) error {
|
||||
resultChan <- MakeFrameWithPayload(Pong, 200, nil)
|
||||
return nil
|
||||
})
|
||||
listener.AddHandler(1, func(input *FrameWithPayload, resultChan chan<- FrameWithPayload) error {
|
||||
|
||||
resultChan <- MakeFrameWithPayload(2, 200, datta)
|
||||
return nil
|
||||
})
|
||||
@@ -21,6 +24,10 @@ func TestGenericConnection(t *testing.T) {
|
||||
if r.Type != 2 {
|
||||
t.Errorf("Expected type 2, got %d\n", r.Type)
|
||||
}
|
||||
response, err := conn.Call(Ping, nil)
|
||||
if err != nil || response.StatusCode != 200 || response.Type != Pong {
|
||||
t.Errorf("Error connecting to remote %v\n", response)
|
||||
}
|
||||
i := 100
|
||||
results := make(chan FrameWithPayload, i)
|
||||
for i > 0 {
|
||||
|
||||
Reference in New Issue
Block a user