moby/pkg/homedir/homedir_test.go
Sebastiaan van Stijn ddd9665289
pkg/homedir: deprecate GetShortcutString() utility
This function was last used in the pkg/mflag package, which was removed
in 14712f9ff0, and is no longer used in
libnetwork code since e6de8aec2f

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-06-26 14:45:21 +02:00

24 lines
526 B
Go

package homedir // import "github.com/docker/docker/pkg/homedir"
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)
}
}
func TestGetShortcutString(t *testing.T) {
shortcut := GetShortcutString() //nolint:staticcheck // ignore SA1019 (GetShortcutString is deprecated)
if shortcut == "" {
t.Fatal("returned shortcut string is empty")
}
}