-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
output_test.go
45 lines (42 loc) · 958 Bytes
/
output_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package main
import (
"bytes"
"testing"
)
func TestNewTSVWriter(t *testing.T) {
tests := []struct {
name string
wantW string
}{
{"New TSV Writer", ""},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
w := &bytes.Buffer{}
if gotW := w.String(); gotW != tt.wantW {
t.Errorf("NewTSVWriter() gotW = %v, want %v", gotW, tt.wantW)
}
})
}
}
func Test_writeTSV(t *testing.T) {
type args struct {
targetHostName string
runresult runresult
blacklist bool
}
tests := []struct {
name string
args args
wantErr bool
}{
{"Write TSV file", args{targetHostName: "deadbeef", runresult: runresult{}, blacklist: false}, false},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if err := writeTSV(tt.args.targetHostName, tt.args.runresult, tt.args.blacklist); (err != nil) != tt.wantErr {
t.Errorf("writeTSV() error = %v, wantErr %v", err, tt.wantErr)
}
})
}
}