2018-02-05 21:05:59 +00:00
|
|
|
package homedir // import "github.com/docker/docker/pkg/homedir"
|
2015-02-06 18:18:49 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"path/filepath"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestGet(t *testing.T) {
|
|
|
|
home := Get()
|
|
|
|
if home == "" {
|
|
|
|
t.Fatal("returned home directory is empty")
|
|
|
|
}
|
|
|
|
|
|
|
|
if !filepath.IsAbs(home) {
|
|
|
|
t.Fatalf("returned path is not absolute: %s", home)
|
|
|
|
}
|
|
|
|
}
|
2015-02-19 06:53:04 +00:00
|
|
|
|
|
|
|
func TestGetShortcutString(t *testing.T) {
|
2023-06-26 11:25:40 +00:00
|
|
|
shortcut := GetShortcutString() //nolint:staticcheck // ignore SA1019 (GetShortcutString is deprecated)
|
2015-02-19 06:53:04 +00:00
|
|
|
if shortcut == "" {
|
|
|
|
t.Fatal("returned shortcut string is empty")
|
|
|
|
}
|
|
|
|
}
|