@@ -126,7 +126,7 @@ func (*testCases) TestBasePath(t *testing.T, fs filesystem.Fs, _ log.DebugLogger
126126}
127127
128128func (* testCases ) TestWorkingDir (t * testing.T , fs filesystem.Fs , _ log.DebugLogger ) {
129- ctx := context . Background ()
129+ ctx := t . Context ()
130130 assert .Equal (t , "my/dir" , fs .WorkingDir ())
131131 require .NoError (t , fs .Mkdir (ctx , "some/dir" ))
132132 fs .SetWorkingDir (ctx , "some/dir" )
@@ -136,7 +136,7 @@ func (*testCases) TestWorkingDir(t *testing.T, fs filesystem.Fs, _ log.DebugLogg
136136}
137137
138138func (* testCases ) TestSubDirFs (t * testing.T , fs filesystem.Fs , _ log.DebugLogger ) {
139- ctx := context . Background ()
139+ ctx := t . Context ()
140140 require .NoError (t , fs .WriteFile (ctx , filesystem .NewRawFile ("sub/dir1/dir2/file.txt" , "foo\n " )))
141141 assert .True (t , fs .IsFile (ctx , `sub/dir1/dir2/file.txt` ))
142142
@@ -205,7 +205,7 @@ func (*testCases) TestSetLogger(t *testing.T, fs filesystem.Fs, _ log.DebugLogge
205205}
206206
207207func (* testCases ) TestWalk (t * testing.T , fs filesystem.Fs , _ log.DebugLogger ) {
208- ctx := context . Background ()
208+ ctx := t . Context ()
209209 require .NoError (t , fs .Mkdir (ctx , "sub/dir1/dir2/dir3" ))
210210 require .NoError (t , fs .WriteFile (ctx , filesystem .NewRawFile ("sub/dir2/file.txt" , "foo\n " )))
211211
@@ -233,7 +233,7 @@ func (*testCases) TestWalk(t *testing.T, fs filesystem.Fs, _ log.DebugLogger) {
233233}
234234
235235func (* testCases ) TestGlob (t * testing.T , fs filesystem.Fs , _ log.DebugLogger ) {
236- ctx := context . Background ()
236+ ctx := t . Context ()
237237 require .NoError (t , fs .Mkdir (ctx , "my/dir1" ))
238238 require .NoError (t , fs .WriteFile (ctx , filesystem .NewRawFile ("my/dir2/file.txt" , "foo\n " )))
239239
@@ -255,15 +255,15 @@ func (*testCases) TestGlob(t *testing.T, fs filesystem.Fs, _ log.DebugLogger) {
255255}
256256
257257func (* testCases ) TestStat (t * testing.T , fs filesystem.Fs , _ log.DebugLogger ) {
258- ctx := context . Background ()
258+ ctx := t . Context ()
259259 require .NoError (t , fs .WriteFile (ctx , filesystem .NewRawFile ("my/dir/file.txt" , "foo\n " )))
260260 s , err := fs .Stat (ctx , `my/dir/file.txt` )
261261 require .NoError (t , err )
262262 assert .False (t , s .IsDir ())
263263}
264264
265265func (* testCases ) TestReadDir (t * testing.T , fs filesystem.Fs , _ log.DebugLogger ) {
266- ctx := context . Background ()
266+ ctx := t . Context ()
267267 require .NoError (t , fs .Mkdir (ctx , "my/dir/subdir" ))
268268 require .NoError (t , fs .WriteFile (ctx , filesystem .NewRawFile ("my/dir/file.txt" , "foo\n " )))
269269
@@ -273,7 +273,7 @@ func (*testCases) TestReadDir(t *testing.T, fs filesystem.Fs, _ log.DebugLogger)
273273}
274274
275275func (* testCases ) TestExists (t * testing.T , fs filesystem.Fs , logger log.DebugLogger ) {
276- ctx := context . Background ()
276+ ctx := t . Context ()
277277 // Create file
278278 filePath := "file.txt"
279279 require .NoError (t , fs .WriteFile (ctx , filesystem .NewRawFile (filePath , "foo\n " )))
@@ -286,7 +286,7 @@ func (*testCases) TestExists(t *testing.T, fs filesystem.Fs, logger log.DebugLog
286286}
287287
288288func (* testCases ) TestIsFile (t * testing.T , fs filesystem.Fs , _ log.DebugLogger ) {
289- ctx := context . Background ()
289+ ctx := t . Context ()
290290 require .NoError (t , fs .Mkdir (ctx , "my/dir" ))
291291 require .NoError (t , fs .WriteFile (ctx , filesystem .NewRawFile ("my/dir/file.txt" , "foo\n " )))
292292
@@ -297,7 +297,7 @@ func (*testCases) TestIsFile(t *testing.T, fs filesystem.Fs, _ log.DebugLogger)
297297}
298298
299299func (* testCases ) TestIsDir (t * testing.T , fs filesystem.Fs , _ log.DebugLogger ) {
300- ctx := context . Background ()
300+ ctx := t . Context ()
301301 require .NoError (t , fs .Mkdir (ctx , "my/dir" ))
302302 require .NoError (t , fs .WriteFile (ctx , filesystem .NewRawFile ("my/dir/file.txt" , "foo\n " )))
303303
@@ -308,7 +308,7 @@ func (*testCases) TestIsDir(t *testing.T, fs filesystem.Fs, _ log.DebugLogger) {
308308}
309309
310310func (* testCases ) TestCreate (t * testing.T , fs filesystem.Fs , _ log.DebugLogger ) {
311- ctx := context . Background ()
311+ ctx := t . Context ()
312312 fd , err := fs .Create (ctx , `file.txt` )
313313 require .NoError (t , err )
314314
@@ -323,7 +323,7 @@ func (*testCases) TestCreate(t *testing.T, fs filesystem.Fs, _ log.DebugLogger)
323323}
324324
325325func (* testCases ) TestOpen (t * testing.T , fs filesystem.Fs , _ log.DebugLogger ) {
326- ctx := context . Background ()
326+ ctx := t . Context ()
327327 require .NoError (t , fs .WriteFile (ctx , filesystem .NewRawFile (`file.txt` , "foo\n " )))
328328
329329 fd , err := fs .Open (ctx , `file.txt` )
@@ -336,7 +336,7 @@ func (*testCases) TestOpen(t *testing.T, fs filesystem.Fs, _ log.DebugLogger) {
336336}
337337
338338func (* testCases ) TestOpenFile (t * testing.T , fs filesystem.Fs , _ log.DebugLogger ) {
339- ctx := context . Background ()
339+ ctx := t . Context ()
340340 require .NoError (t , fs .WriteFile (ctx , filesystem .NewRawFile (`file.txt` , "foo\n " )))
341341
342342 fd , err := fs .OpenFile (ctx , `file.txt` , os .O_RDONLY , 0o600 )
@@ -349,7 +349,7 @@ func (*testCases) TestOpenFile(t *testing.T, fs filesystem.Fs, _ log.DebugLogger
349349}
350350
351351func (* testCases ) TestMkdir (t * testing.T , fs filesystem.Fs , _ log.DebugLogger ) {
352- ctx := context . Background ()
352+ ctx := t . Context ()
353353 assert .False (t , fs .Exists (ctx , "my/dir" ))
354354 require .NoError (t , fs .Mkdir (ctx , "my/dir" ))
355355 assert .True (t , fs .Exists (ctx , "my/dir" ))
@@ -358,7 +358,7 @@ func (*testCases) TestMkdir(t *testing.T, fs filesystem.Fs, _ log.DebugLogger) {
358358}
359359
360360func (* testCases ) TestCopyFile (t * testing.T , fs filesystem.Fs , _ log.DebugLogger ) {
361- ctx := context . Background ()
361+ ctx := t . Context ()
362362 require .NoError (t , fs .Mkdir (ctx , "my/dir1" ))
363363 require .NoError (t , fs .Mkdir (ctx , "my/dir2" ))
364364 require .NoError (t , fs .WriteFile (ctx , filesystem .NewRawFile ("my/dir1/file.txt" , "foo\n " )))
@@ -373,7 +373,7 @@ func (*testCases) TestCopyFile(t *testing.T, fs filesystem.Fs, _ log.DebugLogger
373373}
374374
375375func (* testCases ) TestCopyFileExists (t * testing.T , fs filesystem.Fs , _ log.DebugLogger ) {
376- ctx := context . Background ()
376+ ctx := t . Context ()
377377 require .NoError (t , fs .Mkdir (ctx , "my/dir1" ))
378378 require .NoError (t , fs .Mkdir (ctx , "my/dir2" ))
379379 require .NoError (t , fs .WriteFile (ctx , filesystem .NewRawFile ("my/dir1/file.txt" , "foo\n " )))
@@ -387,7 +387,7 @@ func (*testCases) TestCopyFileExists(t *testing.T, fs filesystem.Fs, _ log.Debug
387387}
388388
389389func (* testCases ) TestCopyForce (t * testing.T , fs filesystem.Fs , _ log.DebugLogger ) {
390- ctx := context . Background ()
390+ ctx := t . Context ()
391391 require .NoError (t , fs .Mkdir (ctx , "my/dir1" ))
392392 require .NoError (t , fs .Mkdir (ctx , "my/dir2" ))
393393 require .NoError (t , fs .WriteFile (ctx , filesystem .NewRawFile ("my/dir1/file.txt" , "foo\n " )))
@@ -405,7 +405,7 @@ func (*testCases) TestCopyForce(t *testing.T, fs filesystem.Fs, _ log.DebugLogge
405405}
406406
407407func (* testCases ) TestCopyDir (t * testing.T , fs filesystem.Fs , _ log.DebugLogger ) {
408- ctx := context . Background ()
408+ ctx := t . Context ()
409409 require .NoError (t , fs .Mkdir (ctx , "my/dir1" ))
410410 require .NoError (t , fs .WriteFile (ctx , filesystem .NewRawFile ("my/dir1/file.txt" , "foo\n " )))
411411
@@ -419,7 +419,7 @@ func (*testCases) TestCopyDir(t *testing.T, fs filesystem.Fs, _ log.DebugLogger)
419419}
420420
421421func (* testCases ) TestCopyDirExists (t * testing.T , fs filesystem.Fs , _ log.DebugLogger ) {
422- ctx := context . Background ()
422+ ctx := t . Context ()
423423 require .NoError (t , fs .Mkdir (ctx , "my/dir1" ))
424424 require .NoError (t , fs .WriteFile (ctx , filesystem .NewRawFile ("my/dir1/file.txt" , "foo\n " )))
425425 require .NoError (t , fs .Mkdir (ctx , "my/dir2" ))
@@ -431,7 +431,7 @@ func (*testCases) TestCopyDirExists(t *testing.T, fs filesystem.Fs, _ log.DebugL
431431}
432432
433433func (* testCases ) TestMoveFile (t * testing.T , fs filesystem.Fs , _ log.DebugLogger ) {
434- ctx := context . Background ()
434+ ctx := t . Context ()
435435 require .NoError (t , fs .Mkdir (ctx , "my/dir1" ))
436436 require .NoError (t , fs .Mkdir (ctx , "my/dir2" ))
437437 require .NoError (t , fs .WriteFile (ctx , filesystem .NewRawFile ("my/dir1/file.txt" , "foo\n " )))
@@ -446,7 +446,7 @@ func (*testCases) TestMoveFile(t *testing.T, fs filesystem.Fs, _ log.DebugLogger
446446}
447447
448448func (* testCases ) TestMoveFileExists (t * testing.T , fs filesystem.Fs , _ log.DebugLogger ) {
449- ctx := context . Background ()
449+ ctx := t . Context ()
450450 require .NoError (t , fs .Mkdir (ctx , "my/dir1" ))
451451 require .NoError (t , fs .Mkdir (ctx , "my/dir2" ))
452452 require .NoError (t , fs .WriteFile (ctx , filesystem .NewRawFile ("my/dir1/file.txt" , "foo\n " )))
@@ -460,7 +460,7 @@ func (*testCases) TestMoveFileExists(t *testing.T, fs filesystem.Fs, _ log.Debug
460460}
461461
462462func (* testCases ) TestMoveForce (t * testing.T , fs filesystem.Fs , _ log.DebugLogger ) {
463- ctx := context . Background ()
463+ ctx := t . Context ()
464464 require .NoError (t , fs .Mkdir (ctx , "my/dir1" ))
465465 require .NoError (t , fs .Mkdir (ctx , "my/dir2" ))
466466 require .NoError (t , fs .WriteFile (ctx , filesystem .NewRawFile ("my/dir1/file.txt" , "foo\n " )))
@@ -478,7 +478,7 @@ func (*testCases) TestMoveForce(t *testing.T, fs filesystem.Fs, _ log.DebugLogge
478478}
479479
480480func (* testCases ) TestMoveDir (t * testing.T , fs filesystem.Fs , _ log.DebugLogger ) {
481- ctx := context . Background ()
481+ ctx := t . Context ()
482482 require .NoError (t , fs .Mkdir (ctx , "my/dir1" ))
483483 require .NoError (t , fs .WriteFile (ctx , filesystem .NewRawFile ("my/dir1/file.txt" , "foo\n " )))
484484
@@ -492,7 +492,7 @@ func (*testCases) TestMoveDir(t *testing.T, fs filesystem.Fs, _ log.DebugLogger)
492492}
493493
494494func (* testCases ) TestMoveDirExists (t * testing.T , fs filesystem.Fs , _ log.DebugLogger ) {
495- ctx := context . Background ()
495+ ctx := t . Context ()
496496 require .NoError (t , fs .Mkdir (ctx , "my/dir1" ))
497497 require .NoError (t , fs .WriteFile (ctx , filesystem .NewRawFile ("my/dir1/file.txt" , "foo\n " )))
498498 require .NoError (t , fs .Mkdir (ctx , "my/dir2" ))
@@ -504,7 +504,7 @@ func (*testCases) TestMoveDirExists(t *testing.T, fs filesystem.Fs, _ log.DebugL
504504}
505505
506506func (* testCases ) TestRemoveFile (t * testing.T , fs filesystem.Fs , _ log.DebugLogger ) {
507- ctx := context . Background ()
507+ ctx := t . Context ()
508508 require .NoError (t , fs .Mkdir (ctx , "my/dir1" ))
509509 require .NoError (t , fs .WriteFile (ctx , filesystem .NewRawFile ("my/dir1/file.txt" , "foo\n " )))
510510
@@ -514,7 +514,7 @@ func (*testCases) TestRemoveFile(t *testing.T, fs filesystem.Fs, _ log.DebugLogg
514514}
515515
516516func (* testCases ) TestRemoveDir (t * testing.T , fs filesystem.Fs , _ log.DebugLogger ) {
517- ctx := context . Background ()
517+ ctx := t . Context ()
518518 require .NoError (t , fs .Mkdir (ctx , "my/dir1" ))
519519 require .NoError (t , fs .WriteFile (ctx , filesystem .NewRawFile ("my/dir1/file.txt" , "foo\n " )))
520520
@@ -524,12 +524,12 @@ func (*testCases) TestRemoveDir(t *testing.T, fs filesystem.Fs, _ log.DebugLogge
524524}
525525
526526func (* testCases ) TestRemoveNotExist (t * testing.T , fs filesystem.Fs , _ log.DebugLogger ) {
527- ctx := context . Background ()
527+ ctx := t . Context ()
528528 require .NoError (t , fs .Remove (ctx , "my/dir1/file.txt" ))
529529}
530530
531531func (* testCases ) TestReadFile (t * testing.T , fs filesystem.Fs , logger log.DebugLogger ) {
532- ctx := context . Background ()
532+ ctx := t . Context ()
533533 // Create file
534534 filePath := "file.txt"
535535 require .NoError (t , fs .WriteFile (ctx , filesystem .NewRawFile (filePath , "foo\n " )))
@@ -544,7 +544,7 @@ func (*testCases) TestReadFile(t *testing.T, fs filesystem.Fs, logger log.DebugL
544544}
545545
546546func (* testCases ) TestReadFileNotFound (t * testing.T , fs filesystem.Fs , logger log.DebugLogger ) {
547- ctx := context . Background ()
547+ ctx := t . Context ()
548548 filePath := "file.txt"
549549 file , err := fs .ReadFile (ctx , filesystem .NewFileDef (filePath ))
550550 require .Error (t , err )
@@ -554,7 +554,7 @@ func (*testCases) TestReadFileNotFound(t *testing.T, fs filesystem.Fs, logger lo
554554}
555555
556556func (* testCases ) TestWriteFile (t * testing.T , fs filesystem.Fs , logger log.DebugLogger ) {
557- ctx := context . Background ()
557+ ctx := t . Context ()
558558 filePath := "file.txt"
559559
560560 // Write
@@ -569,7 +569,7 @@ func (*testCases) TestWriteFile(t *testing.T, fs filesystem.Fs, logger log.Debug
569569}
570570
571571func (* testCases ) TestWriteFileDirNotFound (t * testing.T , fs filesystem.Fs , logger log.DebugLogger ) {
572- ctx := context . Background ()
572+ ctx := t . Context ()
573573 filePath := "my/dir/file.txt"
574574
575575 // Write
@@ -588,7 +588,7 @@ func (*testCases) TestWriteFileDirNotFound(t *testing.T, fs filesystem.Fs, logge
588588}
589589
590590func (* testCases ) TestWriteFile_JsonFile (t * testing.T , fs filesystem.Fs , logger log.DebugLogger ) {
591- ctx := context . Background ()
591+ ctx := t . Context ()
592592 filePath := "file.json"
593593
594594 // Write
@@ -605,7 +605,7 @@ func (*testCases) TestWriteFile_JsonFile(t *testing.T, fs filesystem.Fs, logger
605605}
606606
607607func (* testCases ) TestCreateOrUpdateFile (t * testing.T , fs filesystem.Fs , _ log.DebugLogger ) {
608- ctx := context . Background ()
608+ ctx := t . Context ()
609609 filePath := "file.txt"
610610
611611 // Create empty file
0 commit comments