mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-01-03 15:27:26 -08:00
chore(path): add home tests for mapped locations
This commit is contained in:
parent
f04bf09802
commit
a1801f717c
|
@ -1355,6 +1355,8 @@ func TestReplaceMappedLocations(t *testing.T) {
|
||||||
{Pwd: "/f/g/h/e", Expected: "^/e"},
|
{Pwd: "/f/g/h/e", Expected: "^/e"},
|
||||||
{Pwd: "/a/b/c/d", Expected: "#"},
|
{Pwd: "/a/b/c/d", Expected: "#"},
|
||||||
{Pwd: "/a/b/c/d/e", Expected: "#/e"},
|
{Pwd: "/a/b/c/d/e", Expected: "#/e"},
|
||||||
|
{Pwd: "/a/b/c/d/e", Expected: "#/e"},
|
||||||
|
{Pwd: "/a/b/k/j/e", Expected: "e"},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tc := range cases {
|
for _, tc := range cases {
|
||||||
|
@ -1363,6 +1365,7 @@ func TestReplaceMappedLocations(t *testing.T) {
|
||||||
env.On("Pwd").Return(tc.Pwd)
|
env.On("Pwd").Return(tc.Pwd)
|
||||||
env.On("Shell").Return(shell.FISH)
|
env.On("Shell").Return(shell.FISH)
|
||||||
env.On("GOOS").Return(platform.DARWIN)
|
env.On("GOOS").Return(platform.DARWIN)
|
||||||
|
env.On("Home").Return("/a/b/k")
|
||||||
path := &Path{
|
path := &Path{
|
||||||
env: env,
|
env: env,
|
||||||
props: properties.Map{
|
props: properties.Map{
|
||||||
|
@ -1371,6 +1374,7 @@ func TestReplaceMappedLocations(t *testing.T) {
|
||||||
"/a/b/c/d": "#",
|
"/a/b/c/d": "#",
|
||||||
"/f/g/h/*": "^",
|
"/f/g/h/*": "^",
|
||||||
"/c/l/k/*": "",
|
"/c/l/k/*": "",
|
||||||
|
"~/j/*": "",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue