From e986217ed61a41d4f3b91cbf8b3434d2f0d00fbf Mon Sep 17 00:00:00 2001 From: wuxiangzhou2010 Date: Sat, 14 Apr 2018 11:57:26 +0800 Subject: [PATCH] fix uinitTest failure on win10 --- common/platform/platform_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/platform/platform_test.go b/common/platform/platform_test.go index 00221c7682..706e6634dc 100644 --- a/common/platform/platform_test.go +++ b/common/platform/platform_test.go @@ -3,6 +3,7 @@ package platform_test import ( "os" "path/filepath" + "runtime" "testing" . "v2ray.com/core/common/platform" @@ -52,7 +53,11 @@ func TestGetAssetLocation(t *testing.T) { assert(filepath.Dir(loc), Equals, filepath.Dir(exec)) os.Setenv("v2ray.location.asset", "/v2ray") - assert(GetAssetLocation("t"), Equals, "/v2ray/t") + if runtime.GOOS == "windows" { + assert(GetAssetLocation("t"), Equals, "\\v2ray\\t") + } else { + assert(GetAssetLocation("t"), Equals, "/v2ray/t") + } } func TestGetPluginLocation(t *testing.T) {