增加字符编码/HTTP Header管理

This commit is contained in:
GoEdgeLab
2020-09-16 20:29:26 +08:00
parent 1648192e73
commit afec1c1fe7
22 changed files with 3275 additions and 135 deletions

View 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))
}
}