Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix a unitTest failure on windows #1053

Merged
merged 1 commit into from
Apr 14, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix uinitTest failure on win10
  • Loading branch information
wuxiangzhou2010 committed Apr 14, 2018
commit e986217ed61a41d4f3b91cbf8b3434d2f0d00fbf
7 changes: 6 additions & 1 deletion common/platform/platform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package platform_test
import (
"os"
"path/filepath"
"runtime"
"testing"

. "v2ray.com/core/common/platform"
Expand Down Expand Up @@ -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) {
Expand Down