github.com/rentongzhang/docker@v1.8.2-rc1/pkg/homedir/homedir_test.go (about) 1 package 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 }