MCPcopy
hub / github.com/redis/go-redis / compareFailoverOptions

Function compareFailoverOptions

sentinel_test.go:580–683  ·  view source on GitHub ↗
(t *testing.T, a, e *redis.FailoverOptions)

Source from the content-addressed store, hash-verified

578}
579
580func compareFailoverOptions(t *testing.T, a, e *redis.FailoverOptions) {
581 if a.MasterName != e.MasterName {
582 t.Errorf("MasterName got %q, want %q", a.MasterName, e.MasterName)
583 }
584 compareSlices(t, a.SentinelAddrs, e.SentinelAddrs, "SentinelAddrs")
585 if a.ClientName != e.ClientName {
586 t.Errorf("ClientName got %q, want %q", a.ClientName, e.ClientName)
587 }
588 if a.SentinelUsername != e.SentinelUsername {
589 t.Errorf("SentinelUsername got %q, want %q", a.SentinelUsername, e.SentinelUsername)
590 }
591 if a.SentinelPassword != e.SentinelPassword {
592 t.Errorf("SentinelPassword got %q, want %q", a.SentinelPassword, e.SentinelPassword)
593 }
594 if a.RouteByLatency != e.RouteByLatency {
595 t.Errorf("RouteByLatency got %v, want %v", a.RouteByLatency, e.RouteByLatency)
596 }
597 if a.RouteRandomly != e.RouteRandomly {
598 t.Errorf("RouteRandomly got %v, want %v", a.RouteRandomly, e.RouteRandomly)
599 }
600 if a.ReplicaOnly != e.ReplicaOnly {
601 t.Errorf("ReplicaOnly got %v, want %v", a.ReplicaOnly, e.ReplicaOnly)
602 }
603 if a.UseDisconnectedReplicas != e.UseDisconnectedReplicas {
604 t.Errorf("UseDisconnectedReplicas got %v, want %v", a.UseDisconnectedReplicas, e.UseDisconnectedReplicas)
605 }
606 if a.Protocol != e.Protocol {
607 t.Errorf("Protocol got %v, want %v", a.Protocol, e.Protocol)
608 }
609 if a.Username != e.Username {
610 t.Errorf("Username got %q, want %q", a.Username, e.Username)
611 }
612 if a.Password != e.Password {
613 t.Errorf("Password got %q, want %q", a.Password, e.Password)
614 }
615 if a.DB != e.DB {
616 t.Errorf("DB got %v, want %v", a.DB, e.DB)
617 }
618 if a.MaxRetries != e.MaxRetries {
619 t.Errorf("MaxRetries got %v, want %v", a.MaxRetries, e.MaxRetries)
620 }
621 if a.MinRetryBackoff != e.MinRetryBackoff {
622 t.Errorf("MinRetryBackoff got %v, want %v", a.MinRetryBackoff, e.MinRetryBackoff)
623 }
624 if a.MaxRetryBackoff != e.MaxRetryBackoff {
625 t.Errorf("MaxRetryBackoff got %v, want %v", a.MaxRetryBackoff, e.MaxRetryBackoff)
626 }
627 if a.DialTimeout != e.DialTimeout {
628 t.Errorf("DialTimeout got %v, want %v", a.DialTimeout, e.DialTimeout)
629 }
630 if a.ReadTimeout != e.ReadTimeout {
631 t.Errorf("ReadTimeout got %v, want %v", a.ReadTimeout, e.ReadTimeout)
632 }
633 if a.WriteTimeout != e.WriteTimeout {
634 t.Errorf("WriteTimeout got %v, want %v", a.WriteTimeout, e.WriteTimeout)
635 }
636 if a.ContextTimeoutEnabled != e.ContextTimeoutEnabled {
637 t.Errorf("ContentTimeoutEnabled got %v, want %v", a.ContextTimeoutEnabled, e.ContextTimeoutEnabled)

Callers 1

TestParseSentinelURLFunction · 0.85

Calls 1

compareSlicesFunction · 0.85

Tested by

no test coverage detected