From 98ac46f38fe2de3821809383e0b8aa6eb5dcd0ef Mon Sep 17 00:00:00 2001 From: glorv Date: Tue, 30 Nov 2021 19:54:54 +0800 Subject: [PATCH] fix path compatibility --- br/pkg/lightning/config/config_test.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/br/pkg/lightning/config/config_test.go b/br/pkg/lightning/config/config_test.go index 0368c30b52a04..c4ac134ac924a 100644 --- a/br/pkg/lightning/config/config_test.go +++ b/br/pkg/lightning/config/config_test.go @@ -158,17 +158,15 @@ func (s *configTestSuite) TestAdjustInvalidBackend(c *C) { func (s *configTestSuite) TestCheckAndAdjustFilePath(c *C) { tmpDir := c.MkDir() - - relativePath, err := filepath.Rel(".", tmpDir) - c.Assert(err, IsNil) + // use slashPath in url to be compatible with windows + slashPath := filepath.ToSlash(tmpDir) cfg := config.NewConfig() - cases := []string{ tmpDir, - relativePath, - "file://" + tmpDir, - "local://" + relativePath, + ".", + "file://" + slashPath, + "local://" + slashPath, "s3://bucket_name", "s3://bucket_name/path/to/dir", "gcs://bucketname/path/to/dir",