Skip to content

Commit

Permalink
✅ test: fix a handler unit test error
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Jun 19, 2023
1 parent 693cc04 commit 513ffbb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion handler/writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,14 @@ func TestNewWriteCloser(t *testing.T) {
func TestNewFlushCloser(t *testing.T) {
w := fakeobj.NewWriter()
h := handler.NewFlushCloser(w, slog.AllLevels)
w.WriteString("before flush\n")

r := newLogRecord("TestNewFlushCloser")
assert.NoErr(t, h.Handle(r))
assert.NoErr(t, h.Flush())

str := w.String()
assert.Contains(t, str, "TestNewFlushCloser")

assert.NoErr(t, h.Flush())
assert.NoErr(t, h.Close())
}

0 comments on commit 513ffbb

Please sign in to comment.