1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-10 09:50:43 +00:00
This commit is contained in:
Darien Raymond 2017-12-03 01:04:38 +01:00
parent 0481e6fa42
commit 5e27e3d260
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -90,31 +90,31 @@ func TestRoutingRule(t *testing.T) {
},
},
test: []ruleTest{
ruleTest{
{
input: proxy.ContextWithTarget(context.Background(), net.TCPDestination(net.DomainAddress("v2ray.com"), 80)),
output: true,
},
ruleTest{
{
input: proxy.ContextWithTarget(context.Background(), net.TCPDestination(net.DomainAddress("www.v2ray.com.www"), 80)),
output: true,
},
ruleTest{
{
input: proxy.ContextWithTarget(context.Background(), net.TCPDestination(net.DomainAddress("v2ray.co"), 80)),
output: false,
},
ruleTest{
{
input: proxy.ContextWithTarget(context.Background(), net.TCPDestination(net.DomainAddress("www.google.com"), 80)),
output: true,
},
ruleTest{
{
input: proxy.ContextWithTarget(context.Background(), net.TCPDestination(net.DomainAddress("facebook.com"), 80)),
output: true,
},
ruleTest{
{
input: proxy.ContextWithTarget(context.Background(), net.TCPDestination(net.DomainAddress("www.facebook.com"), 80)),
output: false,
},
ruleTest{
{
input: context.Background(),
output: false,
},
@ -138,19 +138,19 @@ func TestRoutingRule(t *testing.T) {
},
},
test: []ruleTest{
ruleTest{
{
input: proxy.ContextWithTarget(context.Background(), net.TCPDestination(net.ParseAddress("8.8.8.8"), 80)),
output: true,
},
ruleTest{
{
input: proxy.ContextWithTarget(context.Background(), net.TCPDestination(net.ParseAddress("8.8.4.4"), 80)),
output: false,
},
ruleTest{
{
input: proxy.ContextWithTarget(context.Background(), net.TCPDestination(net.ParseAddress("2001:0db8:85a3:0000:0000:8a2e:0370:7334"), 80)),
output: true,
},
ruleTest{
{
input: context.Background(),
output: false,
},
@ -163,15 +163,15 @@ func TestRoutingRule(t *testing.T) {
},
},
test: []ruleTest{
ruleTest{
{
input: protocol.ContextWithUser(context.Background(), &protocol.User{Email: "admin@v2ray.com"}),
output: true,
},
ruleTest{
{
input: protocol.ContextWithUser(context.Background(), &protocol.User{Email: "love@v2ray.com"}),
output: false,
},
ruleTest{
{
input: context.Background(),
output: false,
},