github.com/demonoid81/moby@v0.0.0-20200517203328-62dd8e17c460/pkg/homedir/homedir_test.go (about) 1 package homedir // import "github.com/demonoid81/moby/pkg/homedir" 2 3 import ( 4 "path/filepath" 5 "testing" 6 ) 7 8 func TestGet(t *testing.T) { 9 home := Get() 10 if home == "" { 11 t.Fatal("returned home directory is empty") 12 } 13 14 if !filepath.IsAbs(home) { 15 t.Fatalf("returned path is not absolute: %s", home) 16 } 17 } 18 19 func TestGetShortcutString(t *testing.T) { 20 shortcut := GetShortcutString() 21 if shortcut == "" { 22 t.Fatal("returned shortcut string is empty") 23 } 24 }