mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-29 16:58:34 +00:00
Fix tests (#201)
Co-authored-by: RPRX <63339210+rprx@users.noreply.github.com>
This commit is contained in:
parent
d032a8deb7
commit
4cd343f2d5
7 changed files with 23 additions and 18 deletions
|
@ -55,7 +55,7 @@ func TestAddressReading(t *testing.T) {
|
|||
},
|
||||
{
|
||||
Options: []AddressOption{AddressFamilyByte(0x03, net.AddressFamilyDomain)},
|
||||
Input: []byte{3, 9, 118, 50, 114, 97, 121, 46, 99, 111, 109, 0, 80},
|
||||
Input: []byte{3, 11, 101, 120, 97, 109, 112, 108, 101, 46, 99, 111, 109, 0, 80},
|
||||
Address: net.DomainAddress("example.com"),
|
||||
Port: net.Port(80),
|
||||
},
|
||||
|
@ -84,8 +84,9 @@ func TestAddressReading(t *testing.T) {
|
|||
}
|
||||
|
||||
for _, tc := range data {
|
||||
b := buf.New()
|
||||
parser := NewAddressParser(tc.Options...)
|
||||
|
||||
b := buf.New()
|
||||
addr, port, err := parser.ReadAddressPort(b, bytes.NewReader(tc.Input))
|
||||
b.Release()
|
||||
if tc.Error {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue