This commit is contained in:
unknown
2026-02-04 20:27:13 +08:00
commit 3b042d1dad
9410 changed files with 1488147 additions and 0 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())
}
}