1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-01-05 16:55:27 -05:00

test cases for Equals()

This commit is contained in:
Darien Raymond
2016-01-21 12:05:28 +00:00
parent d75eeed25d
commit 7f4ff04483
3 changed files with 94 additions and 2 deletions

View File

@@ -57,6 +57,12 @@ func (dest *tcpDestination) Port() Port {
}
func (dest *tcpDestination) Equals(another Destination) bool {
if dest == nil && another == nil {
return true
}
if dest == nil || another == nil {
return false
}
if !another.IsTCP() {
return false
}
@@ -97,6 +103,12 @@ func (dest *udpDestination) Port() Port {
}
func (dest *udpDestination) Equals(another Destination) bool {
if dest == nil && another == nil {
return true
}
if dest == nil || another == nil {
return false
}
if !another.IsUDP() {
return false
}