package main import ( "testing" "github.com/stretchr/testify/assert" ) func TestNormalHostName(t *testing.T) { hostName := "hello" assert.Equal(t, hostName, cleanHostName(hostName)) } func TestHostNameWithLocal(t *testing.T) { hostName := "hello.local" assert.Equal(t, "hello", cleanHostName(hostName)) } func TestHostNameWithLan(t *testing.T) { hostName := "hello.lan" cleanHostName := cleanHostName(hostName) assert.Equal(t, "hello", cleanHostName) }