-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathlogger_test.go
More file actions
39 lines (33 loc) · 802 Bytes
/
logger_test.go
File metadata and controls
39 lines (33 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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")
}