Restored the original jww_test file
diff --git a/jww_test.go b/jww_test.go
index 50e20a4..b6d118a 100644
--- a/jww_test.go
+++ b/jww_test.go
@@ -6,52 +6,51 @@
package jwalterweatherman
import (
- "bytes"
- "github.com/stretchr/testify/assert"
- "testing"
+ "bytes"
+ "github.com/stretchr/testify/assert"
+ "testing"
)
func TestLevels(t *testing.T) {
- SetStdoutThreshold(LevelError)
- assert.Equal(t, StdoutThreshold(), LevelError)
- SetLogThreshold(LevelCritical)
- assert.Equal(t, LogThreshold(), LevelCritical)
- assert.NotEqual(t, StdoutThreshold(), LevelCritical)
- SetStdoutThreshold(LevelWarn)
- assert.Equal(t, StdoutThreshold(), LevelWarn)
+ SetStdoutThreshold(LevelError)
+ assert.Equal(t, StdoutThreshold(), LevelError)
+ SetLogThreshold(LevelCritical)
+ assert.Equal(t, LogThreshold(), LevelCritical)
+ assert.NotEqual(t, StdoutThreshold(), LevelCritical)
+ SetStdoutThreshold(LevelWarn)
+ assert.Equal(t, StdoutThreshold(), LevelWarn)
}
func TestDefaultLogging(t *testing.T) {
- outputBuf := new(bytes.Buffer)
- logBuf := new(bytes.Buffer)
- LogHandle = logBuf
- OutHandle = outputBuf
+ outputBuf := new(bytes.Buffer)
+ logBuf := new(bytes.Buffer)
+ LogHandle = logBuf
+ OutHandle = outputBuf
- SetLogThreshold(LevelWarn)
- SetLogFlag(DATE | TIME | LFILE)
- SetStdoutThreshold(LevelError)
+ SetLogThreshold(LevelWarn)
+ SetStdoutThreshold(LevelError)
- FATAL.Println("fatal err")
- CRITICAL.Println("critical err")
- ERROR.Println("an error")
- WARN.Println("a warning")
- INFO.Println("information")
- DEBUG.Println("debugging info")
- TRACE.Println("trace")
+ FATAL.Println("fatal err")
+ CRITICAL.Println("critical err")
+ ERROR.Println("an error")
+ WARN.Println("a warning")
+ INFO.Println("information")
+ DEBUG.Println("debugging info")
+ TRACE.Println("trace")
- assert.Contains(t, logBuf.String(), "fatal err")
- assert.Contains(t, logBuf.String(), "critical err")
- assert.Contains(t, logBuf.String(), "an error")
- assert.Contains(t, logBuf.String(), "a warning")
- assert.NotContains(t, logBuf.String(), "information")
- assert.NotContains(t, logBuf.String(), "debugging info")
- assert.NotContains(t, logBuf.String(), "trace")
+ assert.Contains(t, logBuf.String(), "fatal err")
+ assert.Contains(t, logBuf.String(), "critical err")
+ assert.Contains(t, logBuf.String(), "an error")
+ assert.Contains(t, logBuf.String(), "a warning")
+ assert.NotContains(t, logBuf.String(), "information")
+ assert.NotContains(t, logBuf.String(), "debugging info")
+ assert.NotContains(t, logBuf.String(), "trace")
- assert.Contains(t, outputBuf.String(), "fatal err")
- assert.Contains(t, outputBuf.String(), "critical err")
- assert.Contains(t, outputBuf.String(), "an error")
- assert.NotContains(t, outputBuf.String(), "a warning")
- assert.NotContains(t, outputBuf.String(), "information")
- assert.NotContains(t, outputBuf.String(), "debugging info")
- assert.NotContains(t, outputBuf.String(), "trace")
+ assert.Contains(t, outputBuf.String(), "fatal err")
+ assert.Contains(t, outputBuf.String(), "critical err")
+ assert.Contains(t, outputBuf.String(), "an error")
+ assert.NotContains(t, outputBuf.String(), "a warning")
+ assert.NotContains(t, outputBuf.String(), "information")
+ assert.NotContains(t, outputBuf.String(), "debugging info")
+ assert.NotContains(t, outputBuf.String(), "trace")
}