@@ -149,7 +149,7 @@ struct Fixture {
149149
150150impl Fixture {
151151 fn new ( ) -> gix_testtools:: Result < Fixture > {
152- Self :: for_worktree_path ( fixture_path ( ) )
152+ Self :: for_worktree_path ( fixture_path ( ) ? )
153153 }
154154
155155 fn for_worktree_path ( worktree_path : PathBuf ) -> gix_testtools:: Result < Fixture > {
@@ -212,7 +212,7 @@ impl Fixture {
212212macro_rules! mktest {
213213 ( $name: ident, $case: expr, $number_of_lines: literal) => {
214214 #[ test]
215- fn $name( ) -> gix_testtools:: Result < ( ) > {
215+ fn $name( ) -> gix_testtools:: Result {
216216 let Fixture {
217217 odb,
218218 mut resource_cache,
@@ -238,7 +238,7 @@ macro_rules! mktest {
238238
239239 assert_eq!( lines_blamed. len( ) , $number_of_lines) ;
240240
241- let git_dir = fixture_path( ) . join( ".git" ) ;
241+ let git_dir = fixture_path( ) ? . join( ".git" ) ;
242242 let baseline = Baseline :: collect( git_dir. join( format!( "{}.baseline" , $case) ) , source_file_name) ?;
243243
244244 assert_eq!( baseline. len( ) , $number_of_lines) ;
@@ -324,20 +324,20 @@ fn diff_disparity() {
324324
325325 assert_eq ! ( lines_blamed. len( ) , 5 ) ;
326326
327- let git_dir = fixture_path ( ) . join ( ".git" ) ;
327+ let git_dir = fixture_path ( ) . unwrap ( ) . join ( ".git" ) ;
328328 let baseline = Baseline :: collect ( git_dir. join ( format ! ( "{case}.baseline" ) ) , source_file_name) . unwrap ( ) ;
329329
330330 pretty_assertions:: assert_eq!( lines_blamed, baseline, "{case}" ) ;
331331 }
332332}
333333
334334#[ test]
335- fn since ( ) {
335+ fn since ( ) -> gix_testtools :: Result {
336336 let Fixture {
337337 odb,
338338 mut resource_cache,
339339 suspect,
340- } = Fixture :: new ( ) . unwrap ( ) ;
340+ } = Fixture :: new ( ) ? ;
341341
342342 let source_file_name: gix_object:: bstr:: BString = "simple.txt" . into ( ) ;
343343
@@ -350,32 +350,33 @@ fn since() {
350350 gix_blame:: Options {
351351 diff_algorithm : gix_diff:: blob:: Algorithm :: Histogram ,
352352 range : BlameRanges :: default ( ) ,
353- since : Some ( gix_date:: parse ( "2025-01-31" , None ) . unwrap ( ) ) ,
353+ since : Some ( gix_date:: parse ( "2025-01-31" , None ) ? ) ,
354354 rewrites : Some ( gix_diff:: Rewrites :: default ( ) ) ,
355355 } ,
356- )
357- . unwrap ( )
356+ ) ?
358357 . entries ;
359358
360359 assert_eq ! ( lines_blamed. len( ) , 1 ) ;
361360
362- let git_dir = fixture_path ( ) . join ( ".git" ) ;
363- let baseline = Baseline :: collect ( git_dir. join ( "simple-since.baseline" ) , source_file_name) . unwrap ( ) ;
361+ let git_dir = fixture_path ( ) ? . join ( ".git" ) ;
362+ let baseline = Baseline :: collect ( git_dir. join ( "simple-since.baseline" ) , source_file_name) ? ;
364363
365364 pretty_assertions:: assert_eq!( lines_blamed, baseline) ;
365+
366+ Ok ( ( ) )
366367}
367368
368369mod blame_ranges {
369370 use crate :: { fixture_path, Baseline , Fixture } ;
370371 use gix_blame:: BlameRanges ;
371372
372373 #[ test]
373- fn line_range ( ) {
374+ fn line_range ( ) -> gix_testtools :: Result {
374375 let Fixture {
375376 odb,
376377 mut resource_cache,
377378 suspect,
378- } = Fixture :: new ( ) . unwrap ( ) ;
379+ } = Fixture :: new ( ) ? ;
379380
380381 let source_file_name: gix_object:: bstr:: BString = "simple.txt" . into ( ) ;
381382
@@ -391,25 +392,26 @@ mod blame_ranges {
391392 since : None ,
392393 rewrites : Some ( gix_diff:: Rewrites :: default ( ) ) ,
393394 } ,
394- )
395- . unwrap ( )
395+ ) ?
396396 . entries ;
397397
398398 assert_eq ! ( lines_blamed. len( ) , 2 ) ;
399399
400- let git_dir = fixture_path ( ) . join ( ".git" ) ;
401- let baseline = Baseline :: collect ( git_dir. join ( "simple-lines-1-2.baseline" ) , source_file_name) . unwrap ( ) ;
400+ let git_dir = fixture_path ( ) ? . join ( ".git" ) ;
401+ let baseline = Baseline :: collect ( git_dir. join ( "simple-lines-1-2.baseline" ) , source_file_name) ? ;
402402
403403 pretty_assertions:: assert_eq!( lines_blamed, baseline) ;
404+
405+ Ok ( ( ) )
404406 }
405407
406408 #[ test]
407- fn multiple_ranges_using_add_range ( ) {
409+ fn multiple_ranges_using_add_range ( ) -> gix_testtools :: Result {
408410 let Fixture {
409411 odb,
410412 mut resource_cache,
411413 suspect,
412- } = Fixture :: new ( ) . unwrap ( ) ;
414+ } = Fixture :: new ( ) ? ;
413415
414416 let mut ranges = BlameRanges :: new ( ) ;
415417 ranges. add_range ( 1 ..=2 ) ; // Lines 1-2
@@ -430,29 +432,29 @@ mod blame_ranges {
430432 since : None ,
431433 rewrites : None ,
432434 } ,
433- )
434- . unwrap ( )
435+ ) ?
435436 . entries ;
436437
437438 assert_eq ! ( lines_blamed. len( ) , 3 ) ; // Should have 3 lines total (2 from first range + 1 from second range)
438439
439- let git_dir = fixture_path ( ) . join ( ".git" ) ;
440+ let git_dir = fixture_path ( ) ? . join ( ".git" ) ;
440441 let baseline = Baseline :: collect (
441442 git_dir. join ( "simple-lines-multiple-1-2-and-4.baseline" ) ,
442443 source_file_name,
443- )
444- . unwrap ( ) ;
444+ ) ?;
445445
446446 pretty_assertions:: assert_eq!( lines_blamed, baseline) ;
447+
448+ Ok ( ( ) )
447449 }
448450
449451 #[ test]
450- fn multiple_ranges_usingfrom_ranges ( ) {
452+ fn multiple_ranges_using_from_ranges ( ) -> gix_testtools :: Result {
451453 let Fixture {
452454 odb,
453455 mut resource_cache,
454456 suspect,
455- } = Fixture :: new ( ) . unwrap ( ) ;
457+ } = Fixture :: new ( ) ? ;
456458
457459 let ranges = BlameRanges :: from_ranges ( vec ! [ 1 ..=2 , 1 ..=1 , 4 ..=4 ] ) ;
458460
@@ -470,20 +472,20 @@ mod blame_ranges {
470472 since : None ,
471473 rewrites : None ,
472474 } ,
473- )
474- . unwrap ( )
475+ ) ?
475476 . entries ;
476477
477478 assert_eq ! ( lines_blamed. len( ) , 3 ) ; // Should have 3 lines total (2 from first range + 1 from second range)
478479
479- let git_dir = fixture_path ( ) . join ( ".git" ) ;
480+ let git_dir = fixture_path ( ) ? . join ( ".git" ) ;
480481 let baseline = Baseline :: collect (
481482 git_dir. join ( "simple-lines-multiple-1-2-and-4.baseline" ) ,
482483 source_file_name,
483- )
484- . unwrap ( ) ;
484+ ) ?;
485485
486486 pretty_assertions:: assert_eq!( lines_blamed, baseline) ;
487+
488+ Ok ( ( ) )
487489 }
488490}
489491
@@ -493,14 +495,14 @@ mod rename_tracking {
493495 use crate :: { Baseline , Fixture } ;
494496
495497 #[ test]
496- fn source_file_name_is_tracked_per_hunk ( ) {
497- let worktree_path = gix_testtools:: scripted_fixture_read_only ( "make_blame_rename_tracking_repo.sh" ) . unwrap ( ) ;
498+ fn source_file_name_is_tracked_per_hunk ( ) -> gix_testtools :: Result {
499+ let worktree_path = gix_testtools:: scripted_fixture_read_only ( "make_blame_rename_tracking_repo.sh" ) ? ;
498500
499501 let Fixture {
500502 odb,
501503 mut resource_cache,
502504 suspect,
503- } = Fixture :: for_worktree_path ( worktree_path. to_path_buf ( ) ) . unwrap ( ) ;
505+ } = Fixture :: for_worktree_path ( worktree_path. to_path_buf ( ) ) ? ;
504506
505507 let source_file_name = "after-rename.txt" ;
506508 let lines_blamed = gix_blame:: file (
@@ -515,19 +517,20 @@ mod rename_tracking {
515517 since : None ,
516518 rewrites : Some ( gix_diff:: Rewrites :: default ( ) ) ,
517519 } ,
518- )
519- . unwrap ( )
520+ ) ?
520521 . entries ;
521522
522523 assert_eq ! ( lines_blamed. len( ) , 3 ) ;
523524
524525 let git_dir = worktree_path. join ( ".git" ) ;
525- let baseline = Baseline :: collect ( git_dir. join ( "after-rename.baseline" ) , source_file_name. into ( ) ) . unwrap ( ) ;
526+ let baseline = Baseline :: collect ( git_dir. join ( "after-rename.baseline" ) , source_file_name. into ( ) ) ? ;
526527
527528 pretty_assertions:: assert_eq!( lines_blamed, baseline) ;
529+
530+ Ok ( ( ) )
528531 }
529532}
530533
531- fn fixture_path ( ) -> PathBuf {
532- gix_testtools:: scripted_fixture_read_only ( "make_blame_repo.sh" ) . unwrap ( )
534+ fn fixture_path ( ) -> gix_testtools :: Result < PathBuf > {
535+ gix_testtools:: scripted_fixture_read_only ( "make_blame_repo.sh" )
533536}
0 commit comments