(t *testing.T)
| 44 | } |
| 45 | |
| 46 | func TestDetectImageMediaType(t *testing.T) { |
| 47 | if mt, ok := DetectImageMediaType(onePxPNG); !ok || mt != "image/png" { |
| 48 | t.Errorf("PNG detect = (%q,%v), want image/png,true", mt, ok) |
| 49 | } |
| 50 | if _, ok := DetectImageMediaType([]byte("not an image at all")); ok { |
| 51 | t.Error("plain text must not detect as image") |
| 52 | } |
| 53 | if _, ok := DetectImageMediaType(nil); ok { |
| 54 | t.Error("empty must not detect") |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | func TestSupportedImageMediaTypes(t *testing.T) { |
| 59 | got := SupportedImageMediaTypes() |
nothing calls this directly
no test coverage detected