Skip to content

Commit

Permalink
Merge pull request #1053 from wuxiangzhou2010/master
Browse files Browse the repository at this point in the history
fix a unitTest failure on windows
  • Loading branch information
DarienRaymond authored Apr 14, 2018
2 parents 3c2b75f + e986217 commit 296d3fa
Showing 1 changed file with 6 additions and 1 deletion.
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

0 comments on commit 296d3fa

Please sign in to comment.