1
0
mirror of https://github.com/rclone/rclone.git synced 2026-01-04 17:43:50 +00:00

test: replace defer cleanup with t.Cleanup

Reference: https://pkg.go.dev/testing#T.Cleanup
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
Eng Zer Jun
2022-12-08 20:43:53 +08:00
committed by Nick Craig-Wood
parent be783a1856
commit 8e507075d1
34 changed files with 217 additions and 555 deletions

View File

@@ -26,7 +26,6 @@ func rcNewRun(t *testing.T, method string) (*fstest.Run, *rc.Call) {
// sync/copy: copy a directory from source remote to destination remote
func TestRcCopy(t *testing.T) {
r, call := rcNewRun(t, "sync/copy")
defer r.Finalise()
r.Mkdir(context.Background(), r.Fremote)
file1 := r.WriteBoth(context.Background(), "file1", "file1 contents", t1)
@@ -51,7 +50,6 @@ func TestRcCopy(t *testing.T) {
// sync/move: move a directory from source remote to destination remote
func TestRcMove(t *testing.T) {
r, call := rcNewRun(t, "sync/move")
defer r.Finalise()
r.Mkdir(context.Background(), r.Fremote)
file1 := r.WriteBoth(context.Background(), "file1", "file1 contents", t1)
@@ -76,7 +74,6 @@ func TestRcMove(t *testing.T) {
// sync/sync: sync a directory from source remote to destination remote
func TestRcSync(t *testing.T) {
r, call := rcNewRun(t, "sync/sync")
defer r.Finalise()
r.Mkdir(context.Background(), r.Fremote)
file1 := r.WriteBoth(context.Background(), "file1", "file1 contents", t1)