pathman/winpath/winpath_test.go

24 lines
471 B
Go
Raw Permalink Normal View History

2019-07-22 05:21:47 +00:00
package winpath
import (
"fmt"
"os"
"testing"
)
func TestNormalize(t *testing.T) {
home, _ := os.UserHomeDir()
absexp := ""
homeexp := "%USERPROFILE%" + string(os.PathSeparator) + "foo"
abspath, homepath := NormalizePathEntry(home + string(os.PathSeparator) + "foo")
if absexp != abspath {
t.Error(fmt.Errorf("Expected %q, but got %q", absexp, abspath))
}
if homeexp != homepath {
t.Error(fmt.Errorf("Expected %q, but got %q", homeexp, homepath))
}
}