Skip to content

Commit

Permalink
Add tests for the eventlog package
Browse files Browse the repository at this point in the history
  • Loading branch information
mstmdev committed Mar 11, 2022
1 parent 60d8680 commit 7aaa89e
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions eventlog/event_log_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package eventlog

import (
"io"
"os"
"testing"
)

func TestEventLogStdoutWriter(t *testing.T) {
testEventLogNilWriter(t, os.Stdout)
}

func TestEventLogNilWriter(t *testing.T) {
testEventLogNilWriter(t, nil)
}

func testEventLogNilWriter(t *testing.T, w io.Writer) {
el := New(w)
e := NewEvent("gofs.txt", "Write")
err := el.Write(e)
if err != nil {
t.Errorf("write event error => %s", err)
}
}

0 comments on commit 7aaa89e

Please sign in to comment.