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

Function TestProtocolOptions

options_test.go:252–273  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

250}
251
252func TestProtocolOptions(t *testing.T) {
253 testCasesMap := map[int]int{
254 0: 3,
255 1: 3,
256 2: 2,
257 3: 3,
258 }
259
260 o := &Options{}
261 o.init()
262 if o.Protocol != 3 {
263 t.Errorf("got %d instead of %d as protocol option", o.Protocol, 3)
264 }
265
266 for set, want := range testCasesMap {
267 o := &Options{Protocol: set}
268 o.init()
269 if o.Protocol != want {
270 t.Errorf("got %d instead of %d as protocol option", o.Protocol, want)
271 }
272 }
273}
274
275func TestMaxConcurrentDialsOptions(t *testing.T) {
276 // Test cases for MaxConcurrentDials initialization logic

Callers

nothing calls this directly

Calls 1

initMethod · 0.95

Tested by

no test coverage detected