mirror of
https://github.com/rclone/rclone.git
synced 2025-12-06 00:03:32 +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:
committed by
Nick Craig-Wood
parent
be783a1856
commit
8e507075d1
@@ -178,6 +178,7 @@ func newRunIndividual(t *testing.T, individual bool) *Run {
|
||||
r.Logf = t.Logf
|
||||
r.Fatalf = t.Fatalf
|
||||
r.Logf("Remote %q, Local %q, Modify Window %q", r.Fremote, r.Flocal, fs.GetModifyWindow(ctx, r.Fremote))
|
||||
t.Cleanup(r.Finalise)
|
||||
return r
|
||||
}
|
||||
|
||||
@@ -186,8 +187,6 @@ func newRunIndividual(t *testing.T, individual bool) *Run {
|
||||
//
|
||||
// r.Flocal is an empty local Fs
|
||||
// r.Fremote is an empty remote Fs
|
||||
//
|
||||
// Finalise() will tidy them away when done.
|
||||
func NewRun(t *testing.T) *Run {
|
||||
return newRunIndividual(t, *Individual)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user