mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-12-04 05:43:27 +01:00
Names say what each thing is: no package stutter, one word per concept, spelled out, none that differ only in case. The browser table puts one field per line. Wire names (flags, output fields, keys.json) are unchanged.
23 lines
583 B
Go
23 lines
583 B
Go
package log
|
|
|
|
import (
|
|
"io"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestSetVerbose(t *testing.T) {
|
|
t.Cleanup(func() { defaultLogger.setLevel(infoLevel) })
|
|
|
|
assert.False(t, defaultLogger.enabled(debugLevel), "Debug must be suppressed by default")
|
|
SetVerbose()
|
|
assert.True(t, defaultLogger.enabled(debugLevel), "SetVerbose must enable Debug")
|
|
}
|
|
|
|
func TestSetLevelInvalidPanics(t *testing.T) {
|
|
testLogger := newLogger(io.Discard)
|
|
assert.Panics(t, func() { testLogger.setLevel(debugLevel - 1) })
|
|
assert.Panics(t, func() { testLogger.setLevel(warnLevel + 1) })
|
|
}
|