Skip to content

Commit

Permalink
Improves test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ksysoev committed May 19, 2024
1 parent 99a8b1a commit 619ff6b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ func TestNewServer(t *testing.T) {
if server.mutex == nil {
t.Error("Expected non-nil mutex")
}

server = NewServer("")

if server.addr != ":http" {
t.Errorf("Expected default port :http, but got %s", server.addr)
}
}
func TestServer_AddChannel(t *testing.T) {
// Create a new Server instance
Expand Down Expand Up @@ -232,6 +238,10 @@ func TestServer_Addr(t *testing.T) {

server.AddChannel(channel)

if server.Addr() != nil {
t.Error("Expected nil address for server that is not running")
}

// Start the server in a separate goroutine
done := make(chan struct{})

Expand Down

0 comments on commit 619ff6b

Please sign in to comment.