package api
import "testing"
// The image types a document may reference are served as bytes. SVG joined
// them once the web route began answering it under a sandboxing policy.
func TestDocDirectTypes(t *testing.T) {
for path, want := range map[string]string{
"a.png": "image/png",
"dir/a.JPG": "image/jpeg",
"a.jpeg": "image/jpeg",
"a.gif": "image/gif",
"docs/mark.svg": "image/svg+xml",
"docs/mark.SVG": "image/svg+xml",
"docs/mark.svgz": "",
"docs/mark.svg.md": "",
"Makefile": "",
} {
got, ok := docDirect(path)
if got != want || ok != (want != "") {
t.Errorf("FAIL: docDirect(%q) = %q,%v; want %q", path, got, ok, want)
}
}
}