1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-20 03:17:04 +00:00

Prepare for custom child router(s) via plugin(s) for tomorrow

This commit is contained in:
Makis Maropoulos
2016-07-07 23:59:00 +02:00
parent e3b2c68085
commit 52099314e6
5 changed files with 117 additions and 15 deletions

View File

@@ -103,6 +103,24 @@ func TestServerHostname(t *testing.T) {
}
}
func TestServerFullHost(t *testing.T) {
var server1 Server
var server2 Server
server1.Config.ListeningAddr = "127.0.0.1:8080"
server1.Config.CertFile = "notempty"
server1.Config.KeyFile = "notempty"
server2.Config.ListeningAddr = "127.0.0.1:8080"
server1ExpectingFullhost := "https://" + server1.Config.ListeningAddr
server2ExpectingFullhost := "http://" + server2.Config.ListeningAddr
if server1.FullHost() != server1ExpectingFullhost {
t.Fatalf("Expecting server 1's fullhost to be %s but got %s", server1ExpectingFullhost, server1.FullHost())
}
if server2.FullHost() != server2ExpectingFullhost {
t.Fatalf("Expecting server 2's fullhost to be %s but got %s", server2ExpectingFullhost, server2.FullHost())
}
}
func TestServerPort(t *testing.T) {
var server1, server2 Server
expectedPort1 := 8080