Fix static tests

This commit is contained in:
2025-02-05 18:58:00 +00:00
parent 4a4b24fa45
commit 3d89a77565
4 changed files with 5 additions and 30 deletions
+2 -2
View File
@@ -58,11 +58,11 @@ func Benchmark_NewLogger(b *testing.B) {
got := New()
if tt.triggers.ModFormat.Format != "" {
got = got.SetFormat(tt.triggers.ModFormat.Format)
got.SetFormat(tt.triggers.ModFormat.Format)
}
if tt.triggers.ModLevel.Level != 0 {
got = got.SetMinLogLevel(tt.triggers.ModLevel.Level)
got.SetMinLogLevel(tt.triggers.ModLevel.Level)
}
}
})
-25
View File
@@ -3,7 +3,6 @@ package libpack_logger
import (
"bytes"
"fmt"
"os"
"testing"
"time"
@@ -11,30 +10,6 @@ import (
"github.com/goccy/go-reflect"
)
func captureStderr(f func()) string {
originalStderr := os.Stderr
r, w, _ := os.Pipe()
os.Stderr = w
f()
w.Close()
var buf bytes.Buffer
buf.ReadFrom(r)
os.Stderr = originalStderr
return buf.String()
}
func captureStdOut(f func()) string {
originalStdout := os.Stdout
r, w, _ := os.Pipe()
os.Stdout = w
f()
w.Close()
var buf bytes.Buffer
buf.ReadFrom(r)
os.Stdout = originalStdout
return buf.String()
}
func (suite *LoggerTestSuite) Test_LogMessageString() {
msg := &LogMessage{
Message: "test message",