You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
424 B
24 lines
424 B
3 years ago
|
package browingdata
|
||
3 years ago
|
|
||
|
import (
|
||
|
"os"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func TestNewOutPutter(t *testing.T) {
|
||
2 years ago
|
t.Parallel()
|
||
3 years ago
|
out := NewOutPutter("json")
|
||
3 years ago
|
if out == nil {
|
||
3 years ago
|
t.Error("New() returned nil")
|
||
3 years ago
|
}
|
||
|
f, err := out.CreateFile("results", "test.json")
|
||
|
if err != nil {
|
||
|
t.Error("CreateFile() returned an error", err)
|
||
|
}
|
||
|
defer os.RemoveAll("results")
|
||
|
err = out.Write(nil, f)
|
||
|
if err != nil {
|
||
|
t.Error("Write() returned an error", err)
|
||
|
}
|
||
|
}
|