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
|
||||
|
||||
import (
|
||||
"os/user"
|
||||
"runtime"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestPathExpansion(t *testing.T) {
|
||||
user, _ := user.Current()
|
||||
home := HomeDir()
|
||||
var tests map[string]string
|
||||
|
||||
if runtime.GOOS == "windows" {
|
||||
tests = map[string]string{
|
||||
`/home/someuser/tmp`: `\home\someuser\tmp`,
|
||||
`~/tmp`: user.HomeDir + `\tmp`,
|
||||
`~/tmp`: home + `\tmp`,
|
||||
`~thisOtherUser/b/`: `~thisOtherUser\b`,
|
||||
`$DDDXXX/a/b`: `\tmp\a\b`,
|
||||
`/a/b/`: `\a\b`,
|
||||
|
|
@ -40,7 +39,7 @@ func TestPathExpansion(t *testing.T) {
|
|||
} else {
|
||||
tests = map[string]string{
|
||||
`/home/someuser/tmp`: `/home/someuser/tmp`,
|
||||
`~/tmp`: user.HomeDir + `/tmp`,
|
||||
`~/tmp`: home + `/tmp`,
|
||||
`~thisOtherUser/b/`: `~thisOtherUser/b`,
|
||||
`$DDDXXX/a/b`: `/tmp/a/b`,
|
||||
`/a/b/`: `/a/b`,
|
||||
|
|
|
|||
Loading…
Reference in a new issue