Skip to content

Commit eeb40c9

Browse files
committed
Refine tests
1 parent 095b17d commit eeb40c9

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

common/matcher/geoip/geoip_test.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import (
55
"path/filepath"
66
"testing"
77

8-
"github.com/golang/protobuf/proto"
98
"github.com/xtls/xray-core/common"
109
. "github.com/xtls/xray-core/common/matcher/geoip"
1110
"github.com/xtls/xray-core/common/net"
1211
"github.com/xtls/xray-core/common/platform"
1312
"github.com/xtls/xray-core/common/platform/filesystem"
13+
"google.golang.org/protobuf/proto"
1414
)
1515

1616
func init() {
@@ -20,16 +20,15 @@ func init() {
2020
if _, err := os.Stat(platform.GetAssetLocation("geoip.dat")); err != nil && os.IsNotExist(err) {
2121
common.Must(filesystem.CopyFile(platform.GetAssetLocation("geoip.dat"), filepath.Join(wd, "..", "..", "..", "resources", "geoip.dat")))
2222
}
23+
if _, err := os.Stat(platform.GetAssetLocation("geoiptestrouter.dat")); err != nil && os.IsNotExist(err) {
24+
common.Must(filesystem.CopyFile(platform.GetAssetLocation("geoiptestrouter.dat"), filepath.Join(wd, "..", "..", "..", "resources", "geoip.dat")))
25+
}
2326
if _, err := os.Stat(platform.GetAssetLocation("geosite.dat")); err != nil && os.IsNotExist(err) {
2427
common.Must(filesystem.CopyFile(platform.GetAssetLocation("geosite.dat"), filepath.Join(wd, "..", "..", "..", "resources", "geosite.dat")))
2528
}
2629
}
2730

2831
func TestParseIPList(t *testing.T) {
29-
t.Log(os.Getenv("xray.location.asset"))
30-
31-
common.Must(filesystem.CopyFile(platform.GetAssetLocation("geoiptestrouter.dat"), platform.GetAssetLocation("geoip.dat")))
32-
3332
ips := []string{
3433
"geoip:us",
3534
"geoip:cn",

0 commit comments

Comments
 (0)