Skip to content
This repository was archived by the owner on Mar 23, 2024. It is now read-only.

Commit 67d4fc5

Browse files
author
fbockaj
committed
Add logger tests
1 parent 7e7e52c commit 67d4fc5

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

types/logger_test.go

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package types
2+
3+
import (
4+
"os"
5+
"testing"
6+
)
7+
8+
func TestSyncLoggerDebug(t *testing.T) {
9+
sl := NewSyncLogger(os.Stderr, "", 0)
10+
sl.Debug("Debug test msg")
11+
// Output:
12+
// [DEBUG] signctrl: Debug test msg
13+
}
14+
15+
func TestSyncLoggerInfo(t *testing.T) {
16+
sl := NewSyncLogger(os.Stderr, "", 0)
17+
sl.Info("Info test msg")
18+
// Output:
19+
// [INFO] signctrl: Info test msg
20+
}
21+
22+
func TestSyncLoggerWarn(t *testing.T) {
23+
sl := NewSyncLogger(os.Stderr, "", 0)
24+
sl.Warn("Warn test msg")
25+
// Output:
26+
// [WARN] signctrl: Debug test msg
27+
}
28+
29+
func TestSyncLoggerError(t *testing.T) {
30+
sl := NewSyncLogger(os.Stderr, "", 0)
31+
sl.Error("Error test msg")
32+
// Output:
33+
// [ERR] signctrl: Debug test msg
34+
}

0 commit comments

Comments
 (0)