shoebill/utils/helpers/test.go

23 lines
344 B
Go
Raw Permalink Normal View History

2023-11-05 12:03:35 +00:00
package helpers
import (
"os"
"testing"
)
func CreateFile(t *testing.T) *os.File {
f, err := os.CreateTemp("", "sample")
if err != nil {
t.Error(err)
}
t.Logf("file is created: %s", f.Name())
return f
}
func FillFile(t *testing.T, f *os.File, content string) {
_, err := f.WriteString(content)
if err != nil {
t.Error(err)
}
}