| 26 | ) |
| 27 | |
| 28 | func TestDirs(t *testing.T) { |
| 29 | home := Home |
| 30 | assert.NotEqual(t, home, "", "home is empty") |
| 31 | |
| 32 | configHome := filepath.Join(home, ".config") |
| 33 | dataHome := filepath.Join(home, ".local", "share") |
| 34 | cacheHome := filepath.Join(home, ".cache") |
| 35 | |
| 36 | testCases := []struct { |
| 37 | got string |
| 38 | expected string |
| 39 | }{ |
| 40 | { |
| 41 | got: ConfigHome, |
| 42 | expected: configHome, |
| 43 | }, |
| 44 | { |
| 45 | got: DataHome, |
| 46 | expected: dataHome, |
| 47 | }, |
| 48 | { |
| 49 | got: CacheHome, |
| 50 | expected: cacheHome, |
| 51 | }, |
| 52 | } |
| 53 | |
| 54 | for _, tc := range testCases { |
| 55 | assert.Equal(t, tc.got, tc.expected, "result mismatch") |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | func TestCustomDirs(t *testing.T) { |
| 60 | testCases := []envTestCase{ |