-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcontext_test.go
More file actions
49 lines (42 loc) · 871 Bytes
/
context_test.go
File metadata and controls
49 lines (42 loc) · 871 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
40
41
42
43
44
45
46
47
48
49
package goutils
import "testing"
func Test_NewContext(t *testing.T) {
context := NewContext("test")
if context == nil {
t.Fail()
}
}
func Test_UUID(t *testing.T) {
context := NewContext("test")
if context == nil {
t.Fail()
}
context.SetUUID("test")
if "test" != context.GetUUID() {
t.Fail()
}
context.Notice("format")
}
func Test_AddNotesAndFlush(t *testing.T) {
context := NewContext("test")
if context == nil {
t.Fail()
}
context.AddNotes("test", 1)
context.Flush()
}
func Test_LogLevel(t *testing.T) {
InitLog(nil)
context := NewContext("test")
context.Debug("you will not see me")
context.Info("you will see me")
}
func Test_Log(t *testing.T) {
context := NewContext("test")
context.Debug("debug")
context.Info("info")
context.Warning("warnging")
context.Error("error")
context.Critical("critical")
context.Notice("Notice")
}