mirror of
https://gitlab.crans.org/nounous/ghostream.git
synced 2024-12-23 00:22:19 +00:00
Test splitHostPort
This commit is contained in:
parent
06542590e1
commit
5b5bf2b518
@ -1 +1,17 @@
|
|||||||
package srt
|
package srt
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestSplitHostPort(t *testing.T) {
|
||||||
|
host, port := splitHostPort("127.0.0.1:1234")
|
||||||
|
if host != "127.0.0.1" || port != 1234 {
|
||||||
|
t.Errorf("splitHostPort returned %v:%d != 127.0.0.1:1234", host, port)
|
||||||
|
}
|
||||||
|
|
||||||
|
host, port = splitHostPort(":1234")
|
||||||
|
if host != "0.0.0.0" || port != 1234 {
|
||||||
|
t.Errorf("splitHostPort returned %v:%d != 0.0.0.0:1234", host, port)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user