mirror of
https://github.com/cbednarski/hostess
synced 2024-11-10 01:10:59 +00:00
22 lines
478 B
Go
22 lines
478 B
Go
|
package hostess_test
|
||
|
|
||
|
import (
|
||
|
"github.com/cbednarski/hostess"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func TestFormatHostname(t *testing.T) {
|
||
|
hostname := hostess.Hostname{domain, ip, enabled}
|
||
|
|
||
|
const exp_enabled = "127.0.0.1 localhost"
|
||
|
if hostname.Format() != exp_enabled {
|
||
|
t.Errorf(asserts, hostname.Format(), exp_enabled)
|
||
|
}
|
||
|
|
||
|
hostname.Enabled = false
|
||
|
const exp_disabled = "# 127.0.0.1 localhost"
|
||
|
if hostname.Format() != exp_disabled {
|
||
|
t.Errorf(asserts, hostname.Format(), exp_disabled)
|
||
|
}
|
||
|
}
|