Skip to content

Commit

Permalink
add test case
Browse files Browse the repository at this point in the history
Signed-off-by: taniwa <taniwa@yahoo-corp.jp>
  • Loading branch information
taniwa committed May 17, 2023
1 parent bdda899 commit 3adee22
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions handler/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"context"
"encoding/json"
"fmt"
"math"
"net"
"net/http"
"net/http/httptest"
Expand Down Expand Up @@ -596,6 +597,18 @@ func Test_updateDialContext(t *testing.T) {
}).DialContext,
},
},
{
name: "check if dialContext.timeout is negative, timeout is math.MaxInt64",
args: args{
cfg: &http.Transport{},
dialTimeout: -1,
},
want: &http.Transport{
DialContext: (&net.Dialer{
Timeout: math.MaxInt64,
}).DialContext,
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit 3adee22

Please sign in to comment.