]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: use r.Body.Close to close connection during TestServeFileFromCWD
authorAlex Brainman <alex.brainman@gmail.com>
Mon, 24 Sep 2012 02:48:19 +0000 (12:48 +1000)
committerAlex Brainman <alex.brainman@gmail.com>
Mon, 24 Sep 2012 02:48:19 +0000 (12:48 +1000)
Fixes #3917.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6553061

src/pkg/net/http/fs_test.go

index fb2ccb9bc26627e228e0ba039bcd497d58d5fc31..7c7015c297dfa6edfdaaedf72aa5adc30e8fa14d 100644 (file)
@@ -340,11 +340,6 @@ func TestServeFileMimeType(t *testing.T) {
 }
 
 func TestServeFileFromCWD(t *testing.T) {
-       if runtime.GOOS == "windows" {
-               // TODO(brainman): find out why this test is broken
-               t.Logf("Temporarily skipping test on Windows; see http://golang.org/issue/3917")
-               return
-       }
        ts := httptest.NewServer(HandlerFunc(func(w ResponseWriter, r *Request) {
                ServeFile(w, r, "fs_test.go")
        }))
@@ -353,6 +348,7 @@ func TestServeFileFromCWD(t *testing.T) {
        if err != nil {
                t.Fatal(err)
        }
+       r.Body.Close()
        if r.StatusCode != 200 {
                t.Fatalf("expected 200 OK, got %s", r.Status)
        }