Uncommented test and fixed test case to match intended behavior

pull/13/head
Chris Bednarski 9 years ago
parent beb2cd3397
commit 930ad18681

@ -45,29 +45,29 @@ func TestGetHostsPath(t *testing.T) {
} }
} }
// func TestFormatHostfile(t *testing.T) { func TestFormatHostfile(t *testing.T) {
// // The sort order here is a bit weird. // The sort order here is a bit weird.
// // 1. We want localhost entries at the top // 1. We want localhost entries at the top
// // 2. The rest are sorted by IP as STRINGS, not numeric values, so 10 // 2. The rest are sorted by IP as STRINGS, not numeric values, so 10
// // precedes 8 // precedes 8
// const expected = `127.0.0.1 localhost devsite const expected = `127.0.0.1 localhost devsite
// 127.0.1.1 ip-10-37-12-18 127.0.1.1 ip-10-37-12-18
// 10.37.12.18 devsite.com m.devsite.com # 8.8.8.8 google.com
// # 8.8.8.8 google.com` 10.37.12.18 devsite.com m.devsite.com`
// hostfile := hostess.NewHostfile() hostfile := hostess.NewHostfile()
// hostfile.Path = "./hosts" hostfile.Path = "./hosts"
// hostfile.Hosts.Add(hostess.NewHostname("localhost", "127.0.0.1", true)) hostfile.Hosts.Add(hostess.NewHostname("localhost", "127.0.0.1", true))
// hostfile.Hosts.Add(hostess.NewHostname("ip-10-37-12-18", "127.0.1.1", true)) hostfile.Hosts.Add(hostess.NewHostname("ip-10-37-12-18", "127.0.1.1", true))
// hostfile.Hosts.Add(hostess.NewHostname("devsite", "127.0.0.1", true)) hostfile.Hosts.Add(hostess.NewHostname("devsite", "127.0.0.1", true))
// hostfile.Hosts.Add(hostess.NewHostname("google.com", "8.8.8.8", false)) hostfile.Hosts.Add(hostess.NewHostname("google.com", "8.8.8.8", false))
// hostfile.Hosts.Add(hostess.NewHostname("devsite.com", "10.37.12.18", true)) hostfile.Hosts.Add(hostess.NewHostname("devsite.com", "10.37.12.18", true))
// hostfile.Hosts.Add(hostess.NewHostname("m.devsite.com", "10.37.12.18", true)) hostfile.Hosts.Add(hostess.NewHostname("m.devsite.com", "10.37.12.18", true))
// f := string(hostfile.Format()) f := string(hostfile.Format())
// if f != expected { if f != expected {
// t.Errorf("Hostfile output is not formatted correctly: %s", Diff(expected, f)) t.Errorf("Hostfile output is not formatted correctly: %s", Diff(expected, f))
// } }
// } }
func TestTrimWS(t *testing.T) { func TestTrimWS(t *testing.T) {
const expected = ` candy const expected = ` candy

Loading…
Cancel
Save