mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-27 07:20:19 +00:00
TUN-528: Move cloudflared into a separate repo
This commit is contained in:
38
hello/hello_test.go
Normal file
38
hello/hello_test.go
Normal file
@@ -0,0 +1,38 @@
|
||||
package hello
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestCreateTLSListenerHostAndPortSuccess(t *testing.T) {
|
||||
listener, err := CreateTLSListener("localhost:1234")
|
||||
defer listener.Close()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if listener.Addr().String() == "" {
|
||||
t.Fatal("Fail to find available port")
|
||||
}
|
||||
}
|
||||
|
||||
func TestCreateTLSListenerOnlyHostSuccess(t *testing.T) {
|
||||
listener, err := CreateTLSListener("localhost:")
|
||||
defer listener.Close()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if listener.Addr().String() == "" {
|
||||
t.Fatal("Fail to find available port")
|
||||
}
|
||||
}
|
||||
|
||||
func TestCreateTLSListenerOnlyPortSuccess(t *testing.T) {
|
||||
listener, err := CreateTLSListener(":8888")
|
||||
defer listener.Close()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if listener.Addr().String() == "" {
|
||||
t.Fatal("Fail to find available port")
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user