fix test expandTilde

This commit is contained in:
raziman 2020-08-11 16:15:24 +08:00
parent 42c52e4a78
commit 7a10e25ccb
2 changed files with 9 additions and 4 deletions

View File

@ -27,7 +27,7 @@ type Panel interface {
const (
CONFIG_PATH = ".config/gomu/config"
MUSIC_PATH = "~/music"
MUSIC_PATH = "~/music"
)
// Reads config file and sets the options
@ -112,7 +112,6 @@ func readConfig(args Args) {
}
}
}

View File

@ -1,6 +1,7 @@
package main
import (
"os"
"testing"
"time"
)
@ -83,9 +84,14 @@ func TestEscapeBackSlash(t *testing.T) {
func TestExpandTilde(t *testing.T) {
homeDir, err := os.UserHomeDir()
if err != nil {
t.Errorf("Unable to get home dir: %e", err)
}
sample := map[string]string{
"~/music": "/home/terra/music",
"/home/terra/Music": "/home/terra/Music",
"~/music": homeDir + "/music",
"/home/terra/Music": homeDir + "/Music",
}
for k, v := range sample {