oh-my-posh/src/environment_test.go
2020-12-25 20:11:24 +01:00

24 lines
467 B
Go

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)
}