mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-28 20:39:40 -08:00
parent
1638e2455d
commit
f12ff18385
|
@ -314,28 +314,33 @@ func TestGetFullPath(t *testing.T) {
|
||||||
Pwd string
|
Pwd string
|
||||||
Pswd string
|
Pswd string
|
||||||
Expected string
|
Expected string
|
||||||
|
DisableMappedLocations bool
|
||||||
}{
|
}{
|
||||||
{Style: Full, Pwd: "", Expected: ""},
|
{Style: Full, Pwd: "", Expected: ""},
|
||||||
{Style: Full, Pwd: "/", Expected: "/"},
|
{Style: Full, Pwd: "/", Expected: "/"},
|
||||||
{Style: Full, Pwd: "/usr/home", Expected: "~"},
|
{Style: Full, Pwd: "/usr/home", Expected: "~"},
|
||||||
{Style: Full, Pwd: "/usr/home/abc", Expected: "~/abc"},
|
{Style: Full, Pwd: "/usr/home/abc", Expected: "~/abc"},
|
||||||
|
{Style: Full, Pwd: "/usr/home/abc", Expected: "/usr/home/abc", DisableMappedLocations: true},
|
||||||
{Style: Full, Pwd: "/a/b/c/d", Expected: "/a/b/c/d"},
|
{Style: Full, Pwd: "/a/b/c/d", Expected: "/a/b/c/d"},
|
||||||
|
|
||||||
{Style: Full, FolderSeparatorIcon: "|", Pwd: "", Expected: ""},
|
{Style: Full, FolderSeparatorIcon: "|", Pwd: "", Expected: ""},
|
||||||
{Style: Full, FolderSeparatorIcon: "|", Pwd: "/", Expected: "|"},
|
{Style: Full, FolderSeparatorIcon: "|", Pwd: "/", Expected: "|"},
|
||||||
{Style: Full, FolderSeparatorIcon: "|", Pwd: "/usr/home", Expected: "~"},
|
{Style: Full, FolderSeparatorIcon: "|", Pwd: "/usr/home", Expected: "~"},
|
||||||
|
{Style: Full, FolderSeparatorIcon: "|", Pwd: "/usr/home", Expected: "|usr|home", DisableMappedLocations: true},
|
||||||
{Style: Full, FolderSeparatorIcon: "|", Pwd: "/usr/home/abc", Expected: "~|abc"},
|
{Style: Full, FolderSeparatorIcon: "|", Pwd: "/usr/home/abc", Expected: "~|abc"},
|
||||||
{Style: Full, FolderSeparatorIcon: "|", Pwd: "/a/b/c/d", Expected: "|a|b|c|d"},
|
{Style: Full, FolderSeparatorIcon: "|", Pwd: "/a/b/c/d", Expected: "|a|b|c|d"},
|
||||||
|
|
||||||
{Style: Folder, Pwd: "", Expected: "."},
|
{Style: Folder, Pwd: "", Expected: "."},
|
||||||
{Style: Folder, Pwd: "/", Expected: "/"},
|
{Style: Folder, Pwd: "/", Expected: "/"},
|
||||||
{Style: Folder, Pwd: "/usr/home", Expected: "~"},
|
{Style: Folder, Pwd: "/usr/home", Expected: "~"},
|
||||||
|
{Style: Folder, Pwd: "/usr/home", Expected: "home", DisableMappedLocations: true},
|
||||||
{Style: Folder, Pwd: "/usr/home/abc", Expected: "abc"},
|
{Style: Folder, Pwd: "/usr/home/abc", Expected: "abc"},
|
||||||
{Style: Folder, Pwd: "/a/b/c/d", Expected: "d"},
|
{Style: Folder, Pwd: "/a/b/c/d", Expected: "d"},
|
||||||
|
|
||||||
{Style: Folder, FolderSeparatorIcon: "|", Pwd: "", Expected: "."},
|
{Style: Folder, FolderSeparatorIcon: "|", Pwd: "", Expected: "."},
|
||||||
{Style: Folder, FolderSeparatorIcon: "|", Pwd: "/", Expected: "|"},
|
{Style: Folder, FolderSeparatorIcon: "|", Pwd: "/", Expected: "|"},
|
||||||
{Style: Folder, FolderSeparatorIcon: "|", Pwd: "/usr/home", Expected: "~"},
|
{Style: Folder, FolderSeparatorIcon: "|", Pwd: "/usr/home", Expected: "~"},
|
||||||
|
{Style: Folder, FolderSeparatorIcon: "|", Pwd: "/usr/home", Expected: "home", DisableMappedLocations: true},
|
||||||
{Style: Folder, FolderSeparatorIcon: "|", Pwd: "/usr/home/abc", Expected: "abc"},
|
{Style: Folder, FolderSeparatorIcon: "|", Pwd: "/usr/home/abc", Expected: "abc"},
|
||||||
{Style: Folder, FolderSeparatorIcon: "|", Pwd: "/a/b/c/d", Expected: "d"},
|
{Style: Folder, FolderSeparatorIcon: "|", Pwd: "/a/b/c/d", Expected: "d"},
|
||||||
}
|
}
|
||||||
|
@ -357,6 +362,9 @@ func TestGetFullPath(t *testing.T) {
|
||||||
if tc.FolderSeparatorIcon != "" {
|
if tc.FolderSeparatorIcon != "" {
|
||||||
props.values[FolderSeparatorIcon] = tc.FolderSeparatorIcon
|
props.values[FolderSeparatorIcon] = tc.FolderSeparatorIcon
|
||||||
}
|
}
|
||||||
|
if tc.DisableMappedLocations {
|
||||||
|
props.values[MappedLocationsEnabled] = false
|
||||||
|
}
|
||||||
path := &path{
|
path := &path{
|
||||||
env: env,
|
env: env,
|
||||||
props: props,
|
props: props,
|
||||||
|
|
Loading…
Reference in a new issue