Skip to content

Commit 89c38d8

Browse files
committed
TestWriteHeaders
1 parent 8faf283 commit 89c38d8

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

blaster/blaster_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,22 @@ import (
2323
"github.com/pkg/errors"
2424
)
2525

26+
func TestWriteHeaders(t *testing.T) {
27+
ctx, cancel := context.WithCancel(context.Background())
28+
b := New(ctx, cancel)
29+
log := NewLoggingReadWriteCloser("")
30+
b.SetLog(log)
31+
b.LogData = []string{"a", "b"}
32+
b.LogOutput = []string{"c", "d"}
33+
must(t, b.WriteLogHeaders())
34+
b.Exit()
35+
log.mustWrite(t)
36+
log.mustClose(t)
37+
if log.Buf.String() != "hash,result,a,b,c,d\n" {
38+
t.Fatalf("Log headers not correct. Got: %s", log.Buf.String())
39+
}
40+
}
41+
2642
func TestOpenData(t *testing.T) {
2743
ctx, cancel := context.WithCancel(context.Background())
2844

0 commit comments

Comments
 (0)