|
@@ -1,8 +1,9 @@
|
|
|
-package conf_test
|
|
|
|
|
|
|
+package v4_test
|
|
|
|
|
|
|
|
import (
|
|
import (
|
|
|
"encoding/json"
|
|
"encoding/json"
|
|
|
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
|
|
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
|
|
|
|
|
+ "github.com/v2fly/v2ray-core/v4/infra/conf/v4"
|
|
|
"reflect"
|
|
"reflect"
|
|
|
"testing"
|
|
"testing"
|
|
|
|
|
|
|
@@ -18,7 +19,6 @@ import (
|
|
|
"github.com/v2fly/v2ray-core/v4/common/net"
|
|
"github.com/v2fly/v2ray-core/v4/common/net"
|
|
|
"github.com/v2fly/v2ray-core/v4/common/protocol"
|
|
"github.com/v2fly/v2ray-core/v4/common/protocol"
|
|
|
"github.com/v2fly/v2ray-core/v4/common/serial"
|
|
"github.com/v2fly/v2ray-core/v4/common/serial"
|
|
|
- . "github.com/v2fly/v2ray-core/v4/infra/conf"
|
|
|
|
|
"github.com/v2fly/v2ray-core/v4/proxy/blackhole"
|
|
"github.com/v2fly/v2ray-core/v4/proxy/blackhole"
|
|
|
dns_proxy "github.com/v2fly/v2ray-core/v4/proxy/dns"
|
|
dns_proxy "github.com/v2fly/v2ray-core/v4/proxy/dns"
|
|
|
"github.com/v2fly/v2ray-core/v4/proxy/freedom"
|
|
"github.com/v2fly/v2ray-core/v4/proxy/freedom"
|
|
@@ -33,7 +33,7 @@ import (
|
|
|
func TestV2RayConfig(t *testing.T) {
|
|
func TestV2RayConfig(t *testing.T) {
|
|
|
createParser := func() func(string) (proto.Message, error) {
|
|
createParser := func() func(string) (proto.Message, error) {
|
|
|
return func(s string) (proto.Message, error) {
|
|
return func(s string) (proto.Message, error) {
|
|
|
- config := new(Config)
|
|
|
|
|
|
|
+ config := new(v4.Config)
|
|
|
if err := json.Unmarshal([]byte(s), config); err != nil {
|
|
if err := json.Unmarshal([]byte(s), config); err != nil {
|
|
|
return nil, err
|
|
return nil, err
|
|
|
}
|
|
}
|
|
@@ -363,7 +363,7 @@ func TestMuxConfig_Build(t *testing.T) {
|
|
|
}
|
|
}
|
|
|
for _, tt := range tests {
|
|
for _, tt := range tests {
|
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
|
- m := &MuxConfig{}
|
|
|
|
|
|
|
+ m := &v4.MuxConfig{}
|
|
|
common.Must(json.Unmarshal([]byte(tt.fields), m))
|
|
common.Must(json.Unmarshal([]byte(tt.fields), m))
|
|
|
if got := m.Build(); !reflect.DeepEqual(got, tt.want) {
|
|
if got := m.Build(); !reflect.DeepEqual(got, tt.want) {
|
|
|
t.Errorf("MuxConfig.Build() = %v, want %v", got, tt.want)
|
|
t.Errorf("MuxConfig.Build() = %v, want %v", got, tt.want)
|