improve unit testing case of error logging for ghttp.Server
@@ -52,11 +52,11 @@ func Test_Log(t *testing.T) {
t.Assert(gstr.Contains(gfile.GetContents(logPath1), "HANDLER"), true)
logPath2 := gfile.Join(logDir, "access-"+gtime.Now().Format("Ymd")+".log")
- fmt.Println(gfile.GetContents(logPath2))
+ //fmt.Println(gfile.GetContents(logPath2))
t.Assert(gstr.Contains(gfile.GetContents(logPath2), " /hello "), true)
logPath3 := gfile.Join(logDir, "error-"+gtime.Now().Format("Ymd")+".log")
- t.Assert(gstr.Contains(gfile.GetContents(logPath3), "[ERRO]"), true)
+ //fmt.Println(gfile.GetContents(logPath3))
t.Assert(gstr.Contains(gfile.GetContents(logPath3), "custom error"), true)
})
}
