chore: add more tests (#3187)

This commit is contained in:
Kevin Wan
2023-04-29 22:59:07 +08:00
committed by GitHub
parent 14caf5c799
commit a31256b327
4 changed files with 42 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
package logtest
import (
"errors"
"testing"
"github.com/stretchr/testify/assert"
@@ -15,8 +16,13 @@ func TestCollector(t *testing.T) {
assert.Contains(t, c.String(), input)
}
func TestDiscard(t *testing.T) {
func TestPanicOnFatal(t *testing.T) {
const input = "hello"
Discard(t)
logx.Info(input)
PanicOnFatal(t)
assert.Panics(t, func() {
logx.Must(errors.New("foo"))
})
}