diff options
Diffstat (limited to 'src/net/sendfile_test.go')
| -rw-r--r-- | src/net/sendfile_test.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/net/sendfile_test.go b/src/net/sendfile_test.go index 437d181508..60e22bdede 100644 --- a/src/net/sendfile_test.go +++ b/src/net/sendfile_test.go @@ -28,6 +28,16 @@ const ( newtonSHA256 = "d4a9ac22462b35e7821a4f2706c211093da678620a8f9997989ee7cf8d507bbd" ) +func hookSupportsSendfile(t *testing.T) { + if runtime.GOOS == "windows" { + origHook := testHookSupportsSendfile + testHookSupportsSendfile = func() bool { return true } + t.Cleanup(func() { + testHookSupportsSendfile = origHook + }) + } +} + // expectSendfile runs f, and verifies that internal/poll.SendFile successfully handles // a write to wantConn during f's execution. // @@ -35,6 +45,7 @@ const ( // expect a call to SendFile. func expectSendfile(t *testing.T, wantConn Conn, f func()) { t.Helper() + hookSupportsSendfile(t) if !supportsSendfile() { f() return |
