| 250 | } |
| 251 | |
| 252 | func 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 | |
| 275 | func TestMaxConcurrentDialsOptions(t *testing.T) { |
| 276 | // Test cases for MaxConcurrentDials initialization logic |