From 500c6de359aa41293737fd27fc529bbb19e8e0c5 Mon Sep 17 00:00:00 2001 From: Arthur Morgan <4637240+badO1a5A90@users.noreply.github.com> Date: Wed, 20 Oct 2021 00:52:49 +0800 Subject: [PATCH] adjust --- app/dns/hosts_test.go | 16 ++++++++-------- common/strmatcher/benchmark_test.go | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/dns/hosts_test.go b/app/dns/hosts_test.go index 81998bdc..40533b11 100644 --- a/app/dns/hosts_test.go +++ b/app/dns/hosts_test.go @@ -21,17 +21,17 @@ func TestStaticHosts(t *testing.T) { }, { Type: DomainMatchingType_Full, - Domain: "proxy.v2fly.org", + Domain: "proxy.xray.com", Ip: [][]byte{ {1, 2, 3, 4}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}, }, - ProxiedDomain: "another-proxy.v2fly.org", + ProxiedDomain: "another-proxy.xray.com", }, { Type: DomainMatchingType_Full, - Domain: "proxy2.v2fly.org", - ProxiedDomain: "proxy.v2fly.org", + Domain: "proxy2.xray.com", + ProxiedDomain: "proxy.xray.com", }, { Type: DomainMatchingType_Subdomain, @@ -67,27 +67,27 @@ func TestStaticHosts(t *testing.T) { } { - domain := hosts.Lookup("proxy.v2fly.org", dns.IPOption{ + domain := hosts.Lookup("proxy.xray.com", dns.IPOption{ IPv4Enable: true, IPv6Enable: false, }) if len(domain) != 1 { t.Error("expect 1 domain, but got ", len(domain)) } - if diff := cmp.Diff(domain[0].Domain(), "another-proxy.v2fly.org"); diff != "" { + if diff := cmp.Diff(domain[0].Domain(), "another-proxy.xray.com"); diff != "" { t.Error(diff) } } { - domain := hosts.Lookup("proxy2.v2fly.org", dns.IPOption{ + domain := hosts.Lookup("proxy2.xray.com", dns.IPOption{ IPv4Enable: true, IPv6Enable: false, }) if len(domain) != 1 { t.Error("expect 1 domain, but got ", len(domain)) } - if diff := cmp.Diff(domain[0].Domain(), "another-proxy.v2fly.org"); diff != "" { + if diff := cmp.Diff(domain[0].Domain(), "another-proxy.xray.com"); diff != "" { t.Error(diff) } } diff --git a/common/strmatcher/benchmark_test.go b/common/strmatcher/benchmark_test.go index 9d09140c..972570ce 100644 --- a/common/strmatcher/benchmark_test.go +++ b/common/strmatcher/benchmark_test.go @@ -11,13 +11,13 @@ import ( func BenchmarkACAutomaton(b *testing.B) { ac := NewACAutomaton() for i := 1; i <= 1024; i++ { - ac.Add(strconv.Itoa(i)+".v2ray.com", Domain) + ac.Add(strconv.Itoa(i)+".xray.com", Domain) } ac.Build() b.ResetTimer() for i := 0; i < b.N; i++ { - _ = ac.Match("0.v2ray.com") + _ = ac.Match("0.xray.com") } }