Files
EdgeCommon/pkg/serverconfigs/image_webp_config_test.go

22 lines
540 B
Go
Raw Normal View History

2024-05-17 18:28:59 +08:00
// Copyright 2021 GoEdge CDN goedge.cdn@gmail.com. All rights reserved.
2021-10-01 16:25:31 +08:00
package serverconfigs
import (
"github.com/iwind/TeaGo/assert"
"testing"
)
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"))
}
}