change stuff
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package main
|
||||
|
||||
import "testing"
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestGenericConnection(t *testing.T) {
|
||||
conn := NewConnection("localhost:51337")
|
||||
@@ -17,6 +20,9 @@ func TestGenericConnection(t *testing.T) {
|
||||
resultChan <- MakeFrameWithPayload(2, 200, datta)
|
||||
return nil
|
||||
})
|
||||
listener.AddHandler(3, func(input *FrameWithPayload, resultChan chan<- FrameWithPayload) error {
|
||||
return fmt.Errorf("Error")
|
||||
})
|
||||
r, err := conn.Call(1, datta)
|
||||
if err != nil {
|
||||
t.Errorf("Error calling: %v\n", err)
|
||||
@@ -28,6 +34,11 @@ func TestGenericConnection(t *testing.T) {
|
||||
if err != nil || response.StatusCode != 200 || response.Type != Pong {
|
||||
t.Errorf("Error connecting to remote %v\n", response)
|
||||
}
|
||||
res, err := conn.Call(3, datta)
|
||||
if res.StatusCode == 200 {
|
||||
t.Errorf("Expected error, got %v\n", res)
|
||||
}
|
||||
|
||||
i := 100
|
||||
results := make(chan FrameWithPayload, i)
|
||||
for i > 0 {
|
||||
|
||||
Reference in New Issue
Block a user