Commit 4db54f8d authored by Matt Holt's avatar Matt Holt

Merge pull request #281 from mem/master

Add TestNewDefault to config tests
parents 159eb68a 8f9f6caa
...@@ -8,6 +8,20 @@ import ( ...@@ -8,6 +8,20 @@ import (
"github.com/mholt/caddy/server" "github.com/mholt/caddy/server"
) )
func TestNewDefault(t *testing.T) {
config := NewDefault()
if actual, expected := config.Root, DefaultRoot; actual != expected {
t.Errorf("Root was %s but expected %s", actual, expected)
}
if actual, expected := config.Host, DefaultHost; actual != expected {
t.Errorf("Host was %s but expected %s", actual, expected)
}
if actual, expected := config.Port, DefaultPort; actual != expected {
t.Errorf("Port was %s but expected %s", actual, expected)
}
}
func TestResolveAddr(t *testing.T) { func TestResolveAddr(t *testing.T) {
// NOTE: If tests fail due to comparing to string "127.0.0.1", // NOTE: If tests fail due to comparing to string "127.0.0.1",
// it's possible that system env resolves with IPv6, or ::1. // it's possible that system env resolves with IPv6, or ::1.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment