Merge pull request #1053 from wuxiangzhou2010/master

fix a unitTest failure on windows
pull/1059/head
DarienRaymond 2018-04-14 09:19:00 +02:00 committed by GitHub
commit 296d3fa11c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -3,6 +3,7 @@ package platform_test
import ( import (
"os" "os"
"path/filepath" "path/filepath"
"runtime"
"testing" "testing"
. "v2ray.com/core/common/platform" . "v2ray.com/core/common/platform"
@ -52,7 +53,11 @@ func TestGetAssetLocation(t *testing.T) {
assert(filepath.Dir(loc), Equals, filepath.Dir(exec)) assert(filepath.Dir(loc), Equals, filepath.Dir(exec))
os.Setenv("v2ray.location.asset", "/v2ray") os.Setenv("v2ray.location.asset", "/v2ray")
if runtime.GOOS == "windows" {
assert(GetAssetLocation("t"), Equals, "\\v2ray\\t")
} else {
assert(GetAssetLocation("t"), Equals, "/v2ray/t") assert(GetAssetLocation("t"), Equals, "/v2ray/t")
}
} }
func TestGetPluginLocation(t *testing.T) { func TestGetPluginLocation(t *testing.T) {