Files

24 lines
426 B
Go
Raw Permalink Normal View History

2026-09-23 09:40:59 +08:00
package frp
import (
"strings"
"testing"
)
func TestBuildFRPSConfig(t *testing.T) {
out := BuildFRPSConfig(7000, 18080, 9443, "fonu-dev-token")
if out == "" {
t.Fatal("empty config")
}
for _, want := range []string{
"bindPort = 7000",
"vhostHTTPPort = 18080",
"vhostHTTPSPort = 9443",
`token = "fonu-dev-token"`,
} {
if !strings.Contains(out, want) {
t.Fatalf("missing %q in:\n%s", want, out)
}
}
}