Files

21 lines
419 B
Go

package config
import (
"strings"
"testing"
)
func TestRedactProxyURI(t *testing.T) {
got := RedactProxyURI("https://user:pass@example.com:443/?x=1")
if got != "https://***@example.com:443/?x=1" {
t.Fatalf("got %q", got)
}
if RedactProxyURI("") != "" {
t.Fatal("empty")
}
r := RedactProxyURI("[Interface]\nPrivateKey = abc\n")
if !strings.Contains(r, "скрыт") {
t.Fatalf("awg redact: %q", r)
}
}