From 100acc570aa42d4943d605ea007789ae0fd4f574 Mon Sep 17 00:00:00 2001
From: Nick Craig-Wood <nick@craig-wood.com>
Date: Sat, 18 Jun 2022 15:05:12 +0100
Subject: [PATCH] test_all: fix -clean so it works on remotes with paths

---
 fstest/test_all/clean.go | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fstest/test_all/clean.go b/fstest/test_all/clean.go
index c4d22a8a4..c12a4839a 100644
--- a/fstest/test_all/clean.go
+++ b/fstest/test_all/clean.go
@@ -9,6 +9,7 @@ import (
 	"regexp"
 
 	"github.com/rclone/rclone/fs"
+	"github.com/rclone/rclone/fs/fspath"
 	"github.com/rclone/rclone/fs/list"
 	"github.com/rclone/rclone/fs/operations"
 )
@@ -39,7 +40,7 @@ func cleanFs(ctx context.Context, remote string, cleanup bool) error {
 	}
 	err = entries.ForDirError(func(dir fs.Directory) error {
 		dirPath := dir.Remote()
-		fullPath := remote + dirPath
+		fullPath := fspath.JoinRootPath(remote, dirPath)
 		if MatchTestRemote.MatchString(dirPath) {
 			if *dryRun {
 				log.Printf("Not Purging %s - -dry-run", fullPath)