2024-04-12 11:10:41 +00:00
|
|
|
package browserdata
|
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()
|
2023-03-11 12:09:10 +00:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|