1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-30 05:56:54 -05:00

fix test break for refactor data into seperate package

This commit is contained in:
Shelikhoo 2021-09-04 19:43:10 +01:00
parent 7d02c26219
commit 51f05b1bff
No known key found for this signature in database
GPG Key ID: C4D5E79D22B25316
2 changed files with 4 additions and 2 deletions

View File

@ -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
}

View File

@ -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)