mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-12-25 11:36:35 +08:00
增加字符编码/HTTP Header管理
This commit is contained in:
31
pkg/serverconfigs/http_wildcard_status_test.go
Normal file
31
pkg/serverconfigs/http_wildcard_status_test.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package serverconfigs
|
||||
|
||||
import (
|
||||
"github.com/iwind/TeaGo/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestWildcardStatus_Match(t *testing.T) {
|
||||
a := assert.NewAssertion(t)
|
||||
|
||||
{
|
||||
s := NewWildcardStatus("123")
|
||||
a.IsTrue(s.Match(123))
|
||||
}
|
||||
|
||||
{
|
||||
s := NewWildcardStatus("5x3")
|
||||
a.IsTrue(s.Match(523))
|
||||
a.IsTrue(s.Match(553))
|
||||
}
|
||||
|
||||
{
|
||||
s := NewWildcardStatus("5xx")
|
||||
a.IsTrue(s.Match(523))
|
||||
a.IsTrue(s.Match(553))
|
||||
a.IsTrue(s.Match(500))
|
||||
a.IsFalse(s.Match(5000))
|
||||
a.IsFalse(s.Match(50))
|
||||
a.IsFalse(s.Match(400))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user