Commit b7e9d225 authored by Alex Brainman's avatar Alex Brainman

net/http: test should not leave tmp files behind on windows

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5496067
parent 796a2c19
......@@ -214,14 +214,16 @@ func validateTestMultipartContents(t *testing.T, req *Request, allMem bool) {
t.Error(n, " is *os.File, should not be")
}
}
fd := testMultipartFile(t, req, "filea", "filea.txt", fileaContents)
assertMem("filea", fd)
fd = testMultipartFile(t, req, "fileb", "fileb.txt", filebContents)
fda := testMultipartFile(t, req, "filea", "filea.txt", fileaContents)
defer fda.Close()
assertMem("filea", fda)
fdb := testMultipartFile(t, req, "fileb", "fileb.txt", filebContents)
defer fdb.Close()
if allMem {
assertMem("fileb", fd)
assertMem("fileb", fdb)
} else {
if _, ok := fd.(*os.File); !ok {
t.Errorf("fileb has unexpected underlying type %T", fd)
if _, ok := fdb.(*os.File); !ok {
t.Errorf("fileb has unexpected underlying type %T", fdb)
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment