github.com/v2fly/v2ray-core/v4@v4.45.2/infra/conf/reverse_test.go (about) 1 package conf_test 2 3 import ( 4 "testing" 5 6 "github.com/v2fly/v2ray-core/v4/app/reverse" 7 "github.com/v2fly/v2ray-core/v4/infra/conf" 8 ) 9 10 func TestReverseConfig(t *testing.T) { 11 creator := func() conf.Buildable { 12 return new(conf.ReverseConfig) 13 } 14 15 runMultiTestCase(t, []TestCase{ 16 { 17 Input: `{ 18 "bridges": [{ 19 "tag": "test", 20 "domain": "test.v2fly.org" 21 }] 22 }`, 23 Parser: loadJSON(creator), 24 Output: &reverse.Config{ 25 BridgeConfig: []*reverse.BridgeConfig{ 26 {Tag: "test", Domain: "test.v2fly.org"}, 27 }, 28 }, 29 }, 30 { 31 Input: `{ 32 "portals": [{ 33 "tag": "test", 34 "domain": "test.v2fly.org" 35 }] 36 }`, 37 Parser: loadJSON(creator), 38 Output: &reverse.Config{ 39 PortalConfig: []*reverse.PortalConfig{ 40 {Tag: "test", Domain: "test.v2fly.org"}, 41 }, 42 }, 43 }, 44 }) 45 }