Skip to content

Commit

Permalink
improve test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
reugn committed Sep 13, 2023
1 parent f2a6ffd commit 57fcee1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions quartz/logger/logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ func TestLoggerOff(t *testing.T) {
stdLogger := log.New(&b, "", log.LstdFlags)
logger.SetDefault(logger.NewSimpleLogger(stdLogger, logger.LevelOff))

if logger.Enabled(logger.LevelError) {
t.Fatal("LevelError is enabled")
}
logger.Error("Error")
assertEmpty(&b, t)
logger.Errorf("Error%s", "f")
Expand All @@ -59,11 +62,15 @@ func TestLogFormat(t *testing.T) {
logger.SetDefault(logr)

empty := struct{}{}
logr.Trace("Trace")
assertNotEmpty(&b, t)
logr.Tracef("Tracef: %s, %d, %v, %v", "a", 1, true, empty)
checkLogFormat(&b, t)
logger.Tracef("Tracef: %s, %d, %v, %v", "a", 1, true, empty)
checkLogFormat(&b, t)

logr.Debug("Debug")
assertNotEmpty(&b, t)
logr.Debugf("Debugf: %s, %d, %v, %v", "a", 1, true, empty)
checkLogFormat(&b, t)
logger.Debugf("Debugf: %s, %d, %v, %v", "a", 1, true, empty)
Expand Down

0 comments on commit 57fcee1

Please sign in to comment.