cloudflared-mirror/cmd/cloudflare-warp/hello_test.go

24 lines
419 B
Go
Raw Normal View History

2017-10-16 11:44:03 +00:00
package main
import (
"testing"
)
const testPort = "8080"
func TestNewHelloWorldServer(t *testing.T) {
if NewHelloWorldServer() == nil {
t.Fatal("NewHelloWorldServer returned nil")
}
}
func TestFindAvailablePort(t *testing.T) {
listener, err := findAvailablePort()
if err != nil {
t.Fatal("Fail to find available port")
}
if listener.Addr().String() == "" {
t.Fatal("Fail to find available port")
}
}