mirror of
https://github.com/EchoVault/SugarDB.git
synced 2025-10-05 16:06:57 +08:00
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:
@@ -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()
|
||||
|
Reference in New Issue
Block a user