mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 01:57:12 -05:00
test case for email
This commit is contained in:
parent
069837417f
commit
fcafd4e8f8
@ -6,6 +6,7 @@ import (
|
||||
|
||||
. "v2ray.com/core/app/router"
|
||||
"v2ray.com/core/common/net"
|
||||
"v2ray.com/core/common/protocol"
|
||||
"v2ray.com/core/proxy"
|
||||
"v2ray.com/core/testing/assert"
|
||||
)
|
||||
@ -126,6 +127,23 @@ func TestRoutingRule(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
rule: &RoutingRule{
|
||||
UserEmail: []string{
|
||||
"admin@v2ray.com",
|
||||
},
|
||||
},
|
||||
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,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range cases {
|
||||
|
Loading…
Reference in New Issue
Block a user