实现websocket基本功能

This commit is contained in:
GoEdgeLab
2020-09-26 19:54:20 +08:00
parent 37b5243eef
commit 423a7f5b24
16 changed files with 910 additions and 189 deletions

View File

@@ -0,0 +1,43 @@
package serverconfigs
import (
"github.com/iwind/TeaGo/assert"
"testing"
)
func TestHTTPRootConfig_HasVariables(t *testing.T) {
a := assert.NewAssertion(t)
{
rootConfig := &HTTPRootConfig{
Dir: "",
}
err := rootConfig.Init()
if err != nil {
t.Fatal(err)
}
a.IsFalse(rootConfig.HasVariables())
}
{
rootConfig := &HTTPRootConfig{
Dir: "/home/www",
}
err := rootConfig.Init()
if err != nil {
t.Fatal(err)
}
a.IsFalse(rootConfig.HasVariables())
}
{
rootConfig := &HTTPRootConfig{
Dir: "/home/www/${prefix}/world",
}
err := rootConfig.Init()
if err != nil {
t.Fatal(err)
}
a.IsTrue(rootConfig.HasVariables())
}
}