1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-17 18:06:15 -05:00

fix uinitTest failure on win10

This commit is contained in:
wuxiangzhou2010 2018-04-14 11:57:26 +08:00
parent 3c2b75f548
commit e986217ed6

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,8 +53,12 @@ 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) {
assert := With(t) assert := With(t)