ax(logging): rename TestLoggerLevels/TestLoggerDebugLevel to TestFilename_Function_{Good,Bad,Ugly}
Some checks failed
Test / test (push) Has been cancelled
Security Scan / security (push) Has been cancelled

AX test naming rule: TestFilename_Function_{Good,Bad,Ugly} — all three
categories mandatory. Splits the single test into the three required forms.

Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
Claude 2026-04-02 14:19:05 +01:00
parent 2bfa958cfa
commit 8d323f7570
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -6,20 +6,14 @@ import (
"testing"
)
func TestLoggerLevels(t *testing.T) {
func TestLogger_Log_Good(t *testing.T) {
var buf bytes.Buffer
logger := New(Config{
Output: &buf,
Level: LevelInfo,
})
// Debug should not appear at Info level
logger.Debug("debug message")
if buf.Len() > 0 {
t.Error("Debug message should not appear at Info level")
}
// Info should appear
// Info should appear at Info level
logger.Info("info message")
if !strings.Contains(buf.String(), "[INFO]") {
t.Error("Info message should appear")
@ -43,13 +37,28 @@ func TestLoggerLevels(t *testing.T) {
}
}
func TestLoggerDebugLevel(t *testing.T) {
func TestLogger_Log_Bad(t *testing.T) {
var buf bytes.Buffer
logger := New(Config{
Output: &buf,
Level: LevelInfo,
})
// Debug should not appear at Info level
logger.Debug("debug message")
if buf.Len() > 0 {
t.Error("Debug message should not appear at Info level")
}
}
func TestLogger_Log_Ugly(t *testing.T) {
var buf bytes.Buffer
logger := New(Config{
Output: &buf,
Level: LevelDebug,
})
// All levels should appear at Debug level
logger.Debug("debug message")
if !strings.Contains(buf.String(), "[DEBUG]") {
t.Error("Debug message should appear at Debug level")