mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-11-22 21:26:07 +03:00
19 lines
290 B
Go
19 lines
290 B
Go
|
package net_test
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
. "github.com/xtls/xray-core/v1/common/net"
|
||
|
)
|
||
|
|
||
|
func TestPortRangeContains(t *testing.T) {
|
||
|
portRange := &PortRange{
|
||
|
From: 53,
|
||
|
To: 53,
|
||
|
}
|
||
|
|
||
|
if !portRange.Contains(Port(53)) {
|
||
|
t.Error("expected port range containing 53, but actually not")
|
||
|
}
|
||
|
}
|