MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / TestDefaultTypesRegistered

Function TestDefaultTypesRegistered

imagetype/type_test.go:13–31  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

11)
12
13func TestDefaultTypesRegistered(t *testing.T) {
14 // Test that all default types are properly registered by init()
15 defaultTypes := []imagetype.Type{
16 imagetype.JPEG, imagetype.JXL, imagetype.PNG, imagetype.WEBP, imagetype.GIF,
17 imagetype.ICO, imagetype.SVG, imagetype.HEIC, imagetype.AVIF, imagetype.BMP, imagetype.TIFF,
18 }
19
20 for _, typ := range defaultTypes {
21 t.Run(typ.String(), func(t *testing.T) {
22 desc := imagetype.GetTypeDesc(typ)
23 require.NotNil(t, desc)
24
25 // Verify that the description has non-empty fields
26 require.NotEmpty(t, desc.String)
27 require.NotEmpty(t, desc.Ext)
28 require.NotEqual(t, "application/octet-stream", desc.Mime)
29 })
30 }
31}
32
33func TestDetect(t *testing.T) {
34 tests := []struct {

Callers

nothing calls this directly

Calls 3

GetTypeDescFunction · 0.92
RunMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected