Fix some tests (#3100)

* Sleep for one millisecond in the handler because the `Latency` will return `0s` sometimes and the test will fail

* The `TCPListener.File` is not supported by windows, it is unimplemented now

* Remove the `LF` in the `testdata/template/raw.tmpl`, because if set the git config `core.autocrlf=true`, will append `CR` to the raw.tmpl automatically, then test is failed on Windows
This commit is contained in:
mstmdev
2022-04-21 18:21:46 +08:00
committed by GitHub
parent 696d37e030
commit 444e156fb1
4 changed files with 19 additions and 4 deletions
+2 -2
View File
@@ -202,7 +202,7 @@ func TestLoadHTMLGlobFromFuncMap(t *testing.T) {
}
resp, _ := ioutil.ReadAll(res.Body)
assert.Equal(t, "Date: 2017/07/01\n", string(resp))
assert.Equal(t, "Date: 2017/07/01", string(resp))
}
func init() {
@@ -320,7 +320,7 @@ func TestLoadHTMLFilesFuncMap(t *testing.T) {
}
resp, _ := ioutil.ReadAll(res.Body)
assert.Equal(t, "Date: 2017/07/01\n", string(resp))
assert.Equal(t, "Date: 2017/07/01", string(resp))
}
func TestAddRoute(t *testing.T) {