From b7c759db67fa6ce6ea5e027283a98c4edd31ee34 Mon Sep 17 00:00:00 2001 From: NoahLan <6995syu@163.com> Date: Thu, 20 Jul 2023 17:33:07 +0800 Subject: [PATCH] chore: add more tests --- nlog/writer_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nlog/writer_test.go b/nlog/writer_test.go index 51b1b4c..7942284 100644 --- a/nlog/writer_test.go +++ b/nlog/writer_test.go @@ -97,6 +97,15 @@ func TestConsoleWriter(t *testing.T) { w.(*concreteWriter).statLog = easyToCloseWriter{} } +func TestNewFileWriter(t *testing.T) { + t.Run("access", func(t *testing.T) { + _, err := newFileWriter(LogConf{ + Path: "/not-exists", + }) + assert.Error(t, err) + }) +} + func TestNopWriter(t *testing.T) { assert.NotPanics(t, func() { var w nopWriter