1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-30 14:05:26 -05:00

simplify dependency resolution

This commit is contained in:
Darien Raymond
2018-10-22 11:26:22 +02:00
parent 9decb3fe36
commit 307aac26b3
13 changed files with 135 additions and 56 deletions

View File

@@ -13,12 +13,27 @@ import (
"v2ray.com/core/common/protocol"
"v2ray.com/core/common/serial"
"v2ray.com/core/common/uuid"
"v2ray.com/core/features/dns"
_ "v2ray.com/core/main/distro/all"
"v2ray.com/core/proxy/dokodemo"
"v2ray.com/core/proxy/vmess"
"v2ray.com/core/proxy/vmess/outbound"
)
func TestV2RayDependency(t *testing.T) {
instance := new(Instance)
wait := make(chan bool, 1)
instance.RequireFeatures(func(d dns.Client) {
if d == nil {
t.Error("expected dns client fulfilled, but actually nil")
}
wait <- true
})
instance.AddFeature(dns.LocalClient{})
<-wait
}
func TestV2RayClose(t *testing.T) {
port := net.Port(dice.RollUint16())
userId := uuid.New()