app/history/history_test.go

33 lines
473 B
Go

package history
import (
"testing"
"time"
"kumoly.io/kumoly/app/util"
)
func TestHistory(t *testing.T) {
t.Log("start")
Start(func(h *History) {
t.Logf("%+v\n", h)
})
go func() {
for {
Send(&History{
Module: "test",
Type: INFO,
Message: "testing",
Body: time.Now().String(),
Caller: util.Caller(2),
})
time.Sleep(time.Second)
}
}()
time.Sleep(time.Second * 20)
Stop()
t.Log("stoped")
time.Sleep(time.Second * 2)
}