HackBrowserData/browsingdata/outputter_test.go

24 lines
425 B
Go
Raw Normal View History

2023-07-27 13:08:07 +00:00
package browsingdata
2022-04-10 10:34:38 +00:00
import (
"os"
"testing"
)
func TestNewOutPutter(t *testing.T) {
2022-08-14 13:22:34 +00:00
t.Parallel()
out := newOutPutter("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)
}
}