Skip to content

Commit

Permalink
CAdd test for connection failed
Browse files Browse the repository at this point in the history
  • Loading branch information
KacperMalachowski committed Mar 1, 2024
1 parent 667eeeb commit 52ba2ce
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/td2/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@ func TestConnectDisconnect(t *testing.T) {
}
}

func TestConnectionFailed(t *testing.T) {
ctx := context.Background()
stationHash := "exampleHash"
client := td2.New(ctx, stationHash)

err := client.Connect("127.0.0.1:0")
if err == nil {
t.Error("Expected error on Connect, but got nothing")
}
}

func TestWrite(t *testing.T) {
ctx := context.Background()
stationHash := "exampleHash"
Expand Down

0 comments on commit 52ba2ce

Please sign in to comment.