Fixed bug and added more tests

This commit is contained in:
Faissal Elamraoui
2016-07-28 11:37:28 +02:00
parent 2b867f8152
commit d85293b7c0
4 changed files with 95 additions and 46 deletions

View File

@@ -17,6 +17,7 @@ package logs
import (
"testing"
"time"
"bytes"
)
func TestFormatHeader_0(t *testing.T) {
@@ -55,3 +56,20 @@ func TestFormatHeader_1(t *testing.T) {
tm = tm.Add(dur)
}
}
func TestNewAnsiColor1(t *testing.T) {
inner := bytes.NewBufferString("")
w := NewAnsiColorWriter(inner)
if w == inner {
t.Errorf("Get %#v, want %#v", w, inner)
}
}
func TestNewAnsiColor2(t *testing.T) {
inner := bytes.NewBufferString("")
w1 := NewAnsiColorWriter(inner)
w2 := NewAnsiColorWriter(w1)
if w1 != w2 {
t.Errorf("Get %#v, want %#v", w1, w2)
}
}