github.com/Uhtred009/v2ray-core-1@v4.31.2+incompatible/infra/conf/dns_proxy_test.go (about)

     1  package conf_test
     2  
     3  import (
     4  	"testing"
     5  
     6  	"v2ray.com/core/common/net"
     7  	. "v2ray.com/core/infra/conf"
     8  	"v2ray.com/core/proxy/dns"
     9  )
    10  
    11  func TestDnsProxyConfig(t *testing.T) {
    12  	creator := func() Buildable {
    13  		return new(DnsOutboundConfig)
    14  	}
    15  
    16  	runMultiTestCase(t, []TestCase{
    17  		{
    18  			Input: `{
    19  				"address": "8.8.8.8",
    20  				"port": 53,
    21  				"network": "tcp"
    22  			}`,
    23  			Parser: loadJSON(creator),
    24  			Output: &dns.Config{
    25  				Server: &net.Endpoint{
    26  					Network: net.Network_TCP,
    27  					Address: net.NewIPOrDomain(net.IPAddress([]byte{8, 8, 8, 8})),
    28  					Port:    53,
    29  				},
    30  			},
    31  		},
    32  	})
    33  }