Browse Source

fix test break for refactor data into seperate package

Shelikhoo 4 years ago
parent
commit
51f05b1bff
2 changed files with 4 additions and 2 deletions
  1. 2 1
      infra/conf/v4/transport_test.go
  2. 2 1
      infra/conf/v4/v2ray_test.go

+ 2 - 1
infra/conf/v4/transport_test.go

@@ -2,6 +2,7 @@ package v4_test
 
 import (
 	"encoding/json"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/socketcfg"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
 	"testing"
@@ -24,7 +25,7 @@ import (
 func TestSocketConfig(t *testing.T) {
 	createParser := func() func(string) (proto.Message, error) {
 		return func(s string) (proto.Message, error) {
-			config := new(v4.SocketConfig)
+			config := new(socketcfg.SocketConfig)
 			if err := json.Unmarshal([]byte(s), config); err != nil {
 				return nil, err
 			}

+ 2 - 1
infra/conf/v4/v2ray_test.go

@@ -2,6 +2,7 @@ package v4_test
 
 import (
 	"encoding/json"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/muxcfg"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
 	"google.golang.org/protobuf/types/known/anypb"
@@ -368,7 +369,7 @@ func TestMuxConfig_Build(t *testing.T) {
 	}
 	for _, tt := range tests {
 		t.Run(tt.name, func(t *testing.T) {
-			m := &v4.MuxConfig{}
+			m := &muxcfg.MuxConfig{}
 			common.Must(json.Unmarshal([]byte(tt.fields), m))
 			if got := m.Build(); !reflect.DeepEqual(got, tt.want) {
 				t.Errorf("MuxConfig.Build() = %v, want %v", got, tt.want)