Skip to content

Commit

Permalink
Minor Windows test cases refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
adrg committed Jan 13, 2021
1 parent c523bf8 commit 9ddd388
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions paths_windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,49 +21,49 @@ func TestDefaultBaseDirs(t *testing.T) {
winDir := `C:\Windows`

envSamples := []*envSample{
&envSample{
{
name: "XDG_DATA_HOME",
expected: localAppData,
actual: &xdg.DataHome,
},
&envSample{
{
name: "XDG_DATA_DIRS",
expected: []string{roamingAppData, programData},
actual: &xdg.DataDirs,
},
&envSample{
{
name: "XDG_CONFIG_HOME",
expected: localAppData,
actual: &xdg.ConfigHome,
},
&envSample{
{
name: "XDG_CONFIG_DIRS",
expected: []string{programData},
actual: &xdg.ConfigDirs,
},
&envSample{
{
name: "XDG_CACHE_HOME",
expected: filepath.Join(localAppData, "cache"),
actual: &xdg.CacheHome,
},
&envSample{
{
name: "XDG_RUNTIME_DIR",
expected: localAppData,
actual: &xdg.RuntimeDir,
},
&envSample{
{
name: "XDG_STATE_HOME",
expected: localAppData,
actual: &xdg.StateHome,
},
&envSample{
{
name: "XDG_APPLICATION_DIRS",
expected: []string{
filepath.Join(roamingAppData, "Microsoft", "Windows", "Start Menu", "Programs"),
},
actual: &xdg.ApplicationDirs,
},
&envSample{
{
name: "XDG_FONT_DIRS",
expected: []string{
filepath.Join(winDir, "Fonts"),
Expand Down Expand Up @@ -170,42 +170,42 @@ func TestDefaultUserDirs(t *testing.T) {
public := filepath.Join(home, "Public")

samples := []*envSample{
&envSample{
{
name: "XDG_DESKTOP_DIR",
expected: filepath.Join(home, "Desktop"),
actual: &xdg.UserDirs.Desktop,
},
&envSample{
{
name: "XDG_DOWNLOAD_DIR",
expected: filepath.Join(home, "Downloads"),
actual: &xdg.UserDirs.Download,
},
&envSample{
{
name: "XDG_DOCUMENTS_DIR",
expected: filepath.Join(home, "Documents"),
actual: &xdg.UserDirs.Documents,
},
&envSample{
{
name: "XDG_MUSIC_DIR",
expected: filepath.Join(home, "Music"),
actual: &xdg.UserDirs.Music,
},
&envSample{
{
name: "XDG_PICTURES_DIR",
expected: filepath.Join(home, "Pictures"),
actual: &xdg.UserDirs.Pictures,
},
&envSample{
{
name: "XDG_VIDEOS_DIR",
expected: filepath.Join(home, "Videos"),
actual: &xdg.UserDirs.Videos,
},
&envSample{
{
name: "XDG_TEMPLATES_DIR",
expected: filepath.Join(home, "Templates"),
actual: &xdg.UserDirs.Templates,
},
&envSample{
{
name: "XDG_PUBLICSHARE_DIR",
expected: public,
actual: &xdg.UserDirs.PublicShare,
Expand Down

0 comments on commit 9ddd388

Please sign in to comment.