package magic
import (
"errors"
"strings"
"testing"
"sneak.berlin/go/pixa/internal/imagerequest"
)
// TestDetectFormat_SVG checks that DetectFormat names SVG text with what may
// come before the root element, and does not name as SVG text that does not
// start with "<" or has no "`
tests := []struct {
name string
data string
wantErr error
}{
{name: "root element only", data: root},
{name: "XML declaration", data: `` + "\n" + root},
{name: "byte order mark and white space", data: "\xEF\xBB\xBF \n\t" + root},
{name: "comment", data: "" + root},
{
name: "DOCTYPE",
data: `` + root,
},
{
name: "root element after the first bytes",
data: "" + root,
wantErr: ErrUnknownFormat,
},
{name: "text naming