|
@@ -59,7 +59,7 @@ func TestDebug(t *testing.T) {
|
|
|
t.Error("debug all message not match")
|
|
|
}
|
|
|
|
|
|
- if !strings.Contains(out, "logger.go") {
|
|
|
+ if !strings.Contains(out, "fslog/log_test.go") {
|
|
|
t.Error("debug caller not match")
|
|
|
}
|
|
|
}
|
|
@@ -87,7 +87,7 @@ func TestInfo(t *testing.T) {
|
|
|
t.Error("info fmt all message not match")
|
|
|
}
|
|
|
|
|
|
- if !strings.Contains(out, "logger.go") {
|
|
|
+ if !strings.Contains(out, "fslog/log_test.go") {
|
|
|
t.Error("info caller not match")
|
|
|
}
|
|
|
}
|
|
@@ -115,7 +115,7 @@ func TestWarn(t *testing.T) {
|
|
|
t.Error("warn fmt all message not match")
|
|
|
}
|
|
|
|
|
|
- if !strings.Contains(out, "logger.go") {
|
|
|
+ if !strings.Contains(out, "fslog/log_test.go") {
|
|
|
t.Error("warn caller not match")
|
|
|
}
|
|
|
}
|
|
@@ -143,7 +143,7 @@ func TestError(t *testing.T) {
|
|
|
t.Error("error fmt all message not match")
|
|
|
}
|
|
|
|
|
|
- if !strings.Contains(out, "logger.go") {
|
|
|
+ if !strings.Contains(out, "fslog/log_test.go") {
|
|
|
t.Error("error caller not match")
|
|
|
}
|
|
|
}
|
|
@@ -180,3 +180,13 @@ func TestFileExtend(t *testing.T) {
|
|
|
Info(strconv.Itoa(i))
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+func TestPrintLocation(t *testing.T) {
|
|
|
+ defer Flush()
|
|
|
+ buffer := &bytes.Buffer{}
|
|
|
+ NewOutput(buffer)
|
|
|
+ Info("test location")
|
|
|
+ if !strings.Contains(buffer.String(), `"caller":"fslog/log_test.go:`) {
|
|
|
+ t.Error("caller output have deviation")
|
|
|
+ }
|
|
|
+}
|