Files
go-redis/moduleloadex_nil_test.go
sonnemusk f745ff4409 fix(command): return error on ModuleLoadex with nil config (#3916)
Calling ModuleLoadex(nil) previously panicked in toArgs. Return a sticky
command error instead.
2026-07-22 14:01:52 +03:00

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())
}
}