Replaced fmt.Println statements with log.Println.

Return "empty command" error from handleCommand method if an empty command is passed to the server.
Wait until connection is no longer nil in acl package tests.
This commit is contained in:
Kelvin Clement Mwinuka
2024-05-27 11:45:48 +08:00
parent 9904fcdbb7
commit 0108444d69
14 changed files with 216 additions and 195 deletions

View File

@@ -204,11 +204,20 @@ func Test_HandleAuth(t *testing.T) {
if err != nil {
t.Error(err)
}
for {
// Wait until connection is not nil before breaking out.
if conn != nil {
break
}
}
defer func() {
if conn != nil {
_ = conn.Close()
}
}()
r := resp.NewConn(conn)
tests := []struct {
@@ -423,6 +432,14 @@ func Test_HandleUsers(t *testing.T) {
if err != nil {
t.Error(err)
}
for {
// Wait until connection is not nil before continuing.
if conn != nil {
break
}
}
defer func() {
if conn != nil {
_ = conn.Close()