package redispkg import ( "context" "testing" "time" ) func TestDisabledIsSafe(t *testing.T) { r := New("") ctx := context.Background() if _, ok := r.Get(ctx, "x"); ok { t.Fatal("disabled Get must miss") } r.Set(ctx, "x", "y", time.Second) // 不 panic if n := r.IncrWindow(ctx, "k", time.Second); n != 1 { t.Fatal("disabled IncrWindow must allow") } un, ok := r.Lock(ctx, "lk", time.Second) if !ok { t.Fatal("disabled Lock must always acquire") } un() }