mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-12-04 05:43:27 +01:00
Comments that restated names or narrated the code are gone, and multi-line ones are cut to a line of why. Only comments change: each edited Go file has the same token stream as before. winapi and abe come later.
23 lines
582 B
Go
23 lines
582 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.canLogAt(DebugLevel), "Debug must be suppressed by default")
|
|
SetVerbose()
|
|
assert.True(t, defaultLogger.canLogAt(DebugLevel), "SetVerbose must enable Debug")
|
|
}
|
|
|
|
func TestSetLevelInvalidPanics(t *testing.T) {
|
|
logger := NewLogger(newBase(io.Discard))
|
|
assert.Panics(t, func() { logger.SetLevel(DebugLevel - 1) })
|
|
assert.Panics(t, func() { logger.SetLevel(WarnLevel + 1) })
|
|
}
|