From 1eeeeb853e56188e63aaef251ee745a16fde25fd Mon Sep 17 00:00:00 2001 From: John Date: Tue, 28 Apr 2020 15:21:17 +0800 Subject: [PATCH] improve unit testing case of error logging for ghttp.Server --- net/ghttp/ghttp_unit_log_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ghttp/ghttp_unit_log_test.go b/net/ghttp/ghttp_unit_log_test.go index 1265d2681..3511a97e7 100644 --- a/net/ghttp/ghttp_unit_log_test.go +++ b/net/ghttp/ghttp_unit_log_test.go @@ -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) }) }