Skip to content

Commit 02b5cad

Browse files
committed
add a test
Signed-off-by: fukua95 <[email protected]>
1 parent b0141f0 commit 02b5cad

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

options_test.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,3 +222,26 @@ func TestReadTimeoutOptions(t *testing.T) {
222222
}
223223
}
224224
}
225+
226+
func TestProtocolOptions(t *testing.T) {
227+
testCasesMap := map[int]int{
228+
0: 3,
229+
1: 3,
230+
2: 2,
231+
3: 3,
232+
}
233+
234+
o := &Options{}
235+
o.init()
236+
if o.Protocol != 3 {
237+
t.Errorf("got %d instead of %d as protocol option", o.Protocol, 3)
238+
}
239+
240+
for set, want := range testCasesMap {
241+
o := &Options{Protocol: set}
242+
o.init()
243+
if o.Protocol != want {
244+
t.Errorf("got %d instead of %d as protocol option", o.Protocol, want)
245+
}
246+
}
247+
}

0 commit comments

Comments
 (0)