mirror of
https://github.com/fumiama/terasu-cloudflared.git
synced 2026-06-07 19:10:26 +08:00
TUN-528: Move cloudflared into a separate repo
This commit is contained in:
35
cmd/cloudflared/hello_test.go
Normal file
35
cmd/cloudflared/hello_test.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestCreateListenerHostAndPortSuccess(t *testing.T) {
|
||||
listener, err := createListener("localhost:1234")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if listener.Addr().String() == "" {
|
||||
t.Fatal("Fail to find available port")
|
||||
}
|
||||
}
|
||||
|
||||
func TestCreateListenerOnlyHostSuccess(t *testing.T) {
|
||||
listener, err := createListener("localhost:")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if listener.Addr().String() == "" {
|
||||
t.Fatal("Fail to find available port")
|
||||
}
|
||||
}
|
||||
|
||||
func TestCreateListenerOnlyPortSuccess(t *testing.T) {
|
||||
listener, err := createListener(":8888")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if listener.Addr().String() == "" {
|
||||
t.Fatal("Fail to find available port")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user