Files
EdgeCommon/pkg/serverconfigs/image_webp_config_test.go
GoEdgeLab 2f3981704e v1.4.1
2024-07-27 13:29:26 +08:00

23 lines
541 B
Go

// Copyright 2021 GoEdge CDN goedge.cdn@gmail.com. All rights reserved.
package serverconfigs
import (
"testing"
"github.com/iwind/TeaGo/assert"
)
func TestWebPImageConfig_MatchAccept(t *testing.T) {
var a = assert.NewAssertion(t)
{
var c = &WebPImageConfig{}
a.IsFalse(c.MatchAccept(""))
a.IsTrue(c.MatchAccept("image/webp"))
a.IsTrue(c.MatchAccept("image/webp,image/png"))
a.IsTrue(c.MatchAccept("image/jpeg,image/webp,image/png"))
a.IsFalse(c.MatchAccept("mimage/webp"))
a.IsFalse(c.MatchAccept("image/webpm"))
}
}