mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-20 00:07:06 -05:00
fix test break for refactor data into seperate package
This commit is contained in:
parent
7d02c26219
commit
51f05b1bff
@ -2,6 +2,7 @@ package v4_test
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"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/cfgcommon/testassist"
|
||||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
|
"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
|
||||||
"testing"
|
"testing"
|
||||||
@ -24,7 +25,7 @@ import (
|
|||||||
func TestSocketConfig(t *testing.T) {
|
func TestSocketConfig(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(v4.SocketConfig)
|
config := new(socketcfg.SocketConfig)
|
||||||
if err := json.Unmarshal([]byte(s), config); err != nil {
|
if err := json.Unmarshal([]byte(s), config); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package v4_test
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"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/cfgcommon/testassist"
|
||||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
|
"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
|
||||||
"google.golang.org/protobuf/types/known/anypb"
|
"google.golang.org/protobuf/types/known/anypb"
|
||||||
@ -368,7 +369,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 := &v4.MuxConfig{}
|
m := &muxcfg.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)
|
||||||
|
Loading…
Reference in New Issue
Block a user