Skip to content

Commit

Permalink
fix path compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
glorv committed Nov 30, 2021
1 parent 393f2a6 commit 98ac46f
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions br/pkg/lightning/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 98ac46f

Please sign in to comment.