mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 08:23:47 +01:00
lib/env: Make env_test.go support Windows
This commit is contained in:
parent
9c6f3ae82c
commit
abeb12c6df
9
lib/env/env_test.go
vendored
9
lib/env/env_test.go
vendored
@ -2,6 +2,7 @@ package env
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
homedir "github.com/mitchellh/go-homedir"
|
||||
@ -20,10 +21,10 @@ func TestShellExpand(t *testing.T) {
|
||||
in, want string
|
||||
}{
|
||||
{"", ""},
|
||||
{"~", home},
|
||||
{"~/dir/file.txt", home + "/dir/file.txt"},
|
||||
{"/dir/~/file.txt", "/dir/~/file.txt"},
|
||||
{"~/${EXPAND_TEST}", home + "/potato"},
|
||||
{"~", filepath.FromSlash(home)},
|
||||
{filepath.FromSlash("~/dir/file.txt"), filepath.FromSlash(home + "/dir/file.txt")},
|
||||
{filepath.FromSlash("/dir/~/file.txt"), filepath.FromSlash("/dir/~/file.txt")},
|
||||
{filepath.FromSlash("~/${EXPAND_TEST}"), filepath.FromSlash(home + "/potato")},
|
||||
} {
|
||||
got := ShellExpand(test.in)
|
||||
assert.Equal(t, test.want, got, test.in)
|
||||
|
Loading…
Reference in New Issue
Block a user