예제 #1
0
func TestGetDataHomeFromVariable(t *testing.T) {
	tmp := os.Getenv("XDG_DATA_HOME")
	os.Setenv("XDG_DATA_HOME", "/tmp/foo")

	d := userdir.GetDataHome()
	require.Equal(t, "/tmp/foo", d)

	os.Setenv("XDG_DATA_HOME", tmp)
}
예제 #2
0
func TestGetDataHome(t *testing.T) {
	d := userdir.GetDataHome()
	require.True(t, strings.HasSuffix(d, "AppData/Roaming"))
}
예제 #3
0
func TestGetDataHome(t *testing.T) {
	d := userdir.GetDataHome()
	require.True(t, strings.HasSuffix(d, "Library"))
}
예제 #4
0
func TestGetDataHome(t *testing.T) {
	d := userdir.GetDataHome()
	require.True(t, strings.HasSuffix(d, ".local/share"))
}