mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 14:16:44 +00:00
internal/flags: fix test
This commit is contained in:
parent
a86bc44963
commit
66c4af3e00
1 changed files with 3 additions and 4 deletions
|
|
@ -17,19 +17,18 @@
|
||||||
package flags
|
package flags
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os/user"
|
|
||||||
"runtime"
|
"runtime"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestPathExpansion(t *testing.T) {
|
func TestPathExpansion(t *testing.T) {
|
||||||
user, _ := user.Current()
|
home := HomeDir()
|
||||||
var tests map[string]string
|
var tests map[string]string
|
||||||
|
|
||||||
if runtime.GOOS == "windows" {
|
if runtime.GOOS == "windows" {
|
||||||
tests = map[string]string{
|
tests = map[string]string{
|
||||||
`/home/someuser/tmp`: `\home\someuser\tmp`,
|
`/home/someuser/tmp`: `\home\someuser\tmp`,
|
||||||
`~/tmp`: user.HomeDir + `\tmp`,
|
`~/tmp`: home + `\tmp`,
|
||||||
`~thisOtherUser/b/`: `~thisOtherUser\b`,
|
`~thisOtherUser/b/`: `~thisOtherUser\b`,
|
||||||
`$DDDXXX/a/b`: `\tmp\a\b`,
|
`$DDDXXX/a/b`: `\tmp\a\b`,
|
||||||
`/a/b/`: `\a\b`,
|
`/a/b/`: `\a\b`,
|
||||||
|
|
@ -40,7 +39,7 @@ func TestPathExpansion(t *testing.T) {
|
||||||
} else {
|
} else {
|
||||||
tests = map[string]string{
|
tests = map[string]string{
|
||||||
`/home/someuser/tmp`: `/home/someuser/tmp`,
|
`/home/someuser/tmp`: `/home/someuser/tmp`,
|
||||||
`~/tmp`: user.HomeDir + `/tmp`,
|
`~/tmp`: home + `/tmp`,
|
||||||
`~thisOtherUser/b/`: `~thisOtherUser/b`,
|
`~thisOtherUser/b/`: `~thisOtherUser/b`,
|
||||||
`$DDDXXX/a/b`: `/tmp/a/b`,
|
`$DDDXXX/a/b`: `/tmp/a/b`,
|
||||||
`/a/b/`: `/a/b`,
|
`/a/b/`: `/a/b`,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue