chore: add more tests (#3315)

This commit is contained in:
Kevin Wan
2023-06-01 21:08:44 +08:00
committed by GitHub
parent 3564e36a35
commit 452c9dbcaf
2 changed files with 19 additions and 0 deletions

View File

@@ -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