HackBrowserData/internal/browingdata/outputter_test.go

23 lines
399 B
Go
Raw Normal View History

2022-04-10 10:34:38 +00:00
package outputter
import (
"os"
"testing"
)
func TestNewOutPutter(t *testing.T) {
2022-04-11 11:57:40 +00:00
out := New("json")
2022-04-10 10:34:38 +00:00
if out == nil {
2022-04-11 11:57:40 +00:00
t.Error("New() returned nil")
2022-04-10 10:34:38 +00:00
}
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)
}
}