18 lines
255 B
Go
18 lines
255 B
Go
|
package 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)
|
||
|
}
|
||
|
}
|