mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 01:57:12 -05:00
update test code
This commit is contained in:
parent
521db6bdb4
commit
b22f306a3d
@ -16,15 +16,15 @@ func TestClientSampleConfig(t *testing.T) {
|
||||
config, err := LoadConfig(filepath.Join(baseDir, "vpoint_socks_vmess.json"))
|
||||
assert.Error(err).IsNil()
|
||||
|
||||
assert.Uint16(config.PortValue).Positive()
|
||||
assert.Pointer(config.InboundConfigValue).IsNotNil()
|
||||
assert.Pointer(config.OutboundConfigValue).IsNotNil()
|
||||
assert.Uint16(config.Port()).Positive()
|
||||
assert.Pointer(config.InboundConfig()).IsNotNil()
|
||||
assert.Pointer(config.OutboundConfig()).IsNotNil()
|
||||
|
||||
assert.String(config.InboundConfigValue.ProtocolString).Equals("socks")
|
||||
assert.Int(len(config.InboundConfigValue.Content())).GreaterThan(0)
|
||||
assert.String(config.InboundConfig().Protocol()).Equals("socks")
|
||||
assert.Int(len(config.InboundConfig().Content())).GreaterThan(0)
|
||||
|
||||
assert.String(config.OutboundConfigValue.ProtocolString).Equals("vmess")
|
||||
assert.Int(len(config.OutboundConfigValue.Content())).GreaterThan(0)
|
||||
assert.String(config.OutboundConfig().Protocol()).Equals("vmess")
|
||||
assert.Int(len(config.OutboundConfig().Content())).GreaterThan(0)
|
||||
}
|
||||
|
||||
func TestServerSampleConfig(t *testing.T) {
|
||||
@ -36,12 +36,13 @@ func TestServerSampleConfig(t *testing.T) {
|
||||
config, err := LoadConfig(filepath.Join(baseDir, "vpoint_vmess_freedom.json"))
|
||||
assert.Error(err).IsNil()
|
||||
|
||||
assert.Uint16(config.PortValue).Positive()
|
||||
assert.Pointer(config.InboundConfigValue).IsNotNil()
|
||||
assert.Pointer(config.OutboundConfigValue).IsNotNil()
|
||||
assert.Uint16(config.Port()).Positive()
|
||||
assert.Pointer(config.InboundConfig()).IsNotNil()
|
||||
assert.Pointer(config.OutboundConfig()).IsNotNil()
|
||||
|
||||
assert.String(config.InboundConfigValue.ProtocolString).Equals("vmess")
|
||||
assert.Int(len(config.InboundConfigValue.Content())).GreaterThan(0)
|
||||
assert.String(config.InboundConfig().Protocol()).Equals("vmess")
|
||||
assert.Int(len(config.InboundConfig().Content())).GreaterThan(0)
|
||||
|
||||
assert.String(config.OutboundConfigValue.ProtocolString).Equals("freedom")
|
||||
assert.String(config.OutboundConfig().Protocol()).Equals("freedom")
|
||||
assert.Int(len(config.OutboundConfig().Content())).Equals(0)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user