mirror of
https://github.com/redis/go-redis.git
synced 2026-10-28 08:24:54 +08:00
Calling ModuleLoadex(nil) previously panicked in toArgs. Return a sticky command error instead.
18 lines
366 B
Go
18 lines
366 B
Go
package redis
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
)
|
|
|
|
func TestModuleLoadexNilConfig(t *testing.T) {
|
|
rdb := NewClient(&Options{Addr: "localhost:6379"})
|
|
cmd := rdb.ModuleLoadex(context.Background(), nil)
|
|
if cmd.Err() == nil {
|
|
t.Fatal("expected error for nil config")
|
|
}
|
|
if cmd.Err().Error() != "redis: ModuleLoadex nil config" {
|
|
t.Fatalf("got %v", cmd.Err())
|
|
}
|
|
}
|