mirror of https://github.com/maxcnunes/gaper.git
40 lines
802 B
Go
40 lines
802 B
Go
package gaper
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestLoggerDefault(t *testing.T) {
|
|
l := newLogger("gaper-test")
|
|
assert.Equal(t, l.verbose, false)
|
|
}
|
|
|
|
func TestLoggerEnableVerbose(t *testing.T) {
|
|
l := newLogger("gaper-test")
|
|
l.Verbose(true)
|
|
assert.Equal(t, l.verbose, true)
|
|
}
|
|
|
|
func TestLoggerRunAllLogsWithoutVerbose(t *testing.T) {
|
|
// no asserts, just checking it doesn't crash
|
|
l := newLogger("gaper-test")
|
|
l.Debug("debug")
|
|
l.Debugf("%s", "debug")
|
|
l.Info("info")
|
|
l.Error("error")
|
|
l.Errorf("%s", "error")
|
|
}
|
|
|
|
func TestLoggerRunAllLogsWithVerbose(t *testing.T) {
|
|
// no asserts, just checking it doesn't crash
|
|
l := newLogger("gaper-test")
|
|
l.Verbose(true)
|
|
l.Debug("debug")
|
|
l.Debugf("%s", "debug")
|
|
l.Info("info")
|
|
l.Error("error")
|
|
l.Errorf("%s", "error")
|
|
}
|