| 1234567891011121314151617181920212223242526272829303132 | // +build jsonpackage net_testimport (	"encoding/json"	"testing"	. "github.com/v2ray/v2ray-core/common/net"	v2testing "github.com/v2ray/v2ray-core/testing"	"github.com/v2ray/v2ray-core/testing/assert")func TestArrayNetworkList(t *testing.T) {	v2testing.Current(t)	var list NetworkList	err := json.Unmarshal([]byte("[\"Tcp\"]"), &list)	assert.Error(err).IsNil()	assert.Bool(list.HasNetwork(Network("tcp"))).IsTrue()	assert.Bool(list.HasNetwork(Network("udp"))).IsFalse()}func TestStringNetworkList(t *testing.T) {	v2testing.Current(t)	var list NetworkList	err := json.Unmarshal([]byte("\"TCP, ip\""), &list)	assert.Error(err).IsNil()	assert.Bool(list.HasNetwork(Network("tcp"))).IsTrue()	assert.Bool(list.HasNetwork(Network("udp"))).IsFalse()}
 |