@@ -382,13 +382,13 @@ pub mod path {
382
382
}
383
383
384
384
#[ cfg( test) ]
385
- mod tests {
385
+ mod interpolate_tests {
386
386
use std:: borrow:: Cow ;
387
387
388
388
use crate :: values:: { path:: interpolate:: Error , Path } ;
389
389
390
390
#[ test]
391
- fn not_interpolated ( ) {
391
+ fn no_interpolation_for_paths_without_tilde_or_prefix ( ) {
392
392
let path = & b"/foo/bar" [ ..] ;
393
393
let actual = Path :: from ( Cow :: Borrowed ( path) ) ;
394
394
assert_eq ! ( & * actual, path) ;
@@ -399,15 +399,15 @@ pub mod path {
399
399
}
400
400
401
401
#[ test]
402
- fn empty_is_error ( ) {
402
+ fn empty_path_is_error ( ) {
403
403
assert ! ( matches!(
404
404
Path :: from( Cow :: Borrowed ( "" . as_bytes( ) ) ) . interpolate( None ) ,
405
405
Err ( Error :: Missing { what: "path" } )
406
406
) ) ;
407
407
}
408
408
409
409
#[ test]
410
- fn prefix_interpolated ( ) {
410
+ fn prefix_substitutes_git_install_dir ( ) {
411
411
for git_install_dir in & [ "/tmp/git" , "C:\\ git" ] {
412
412
for ( val, expected) in & [
413
413
( & b"%(prefix)/foo/bar" [ ..] , "foo/bar" ) ,
@@ -431,7 +431,7 @@ pub mod path {
431
431
}
432
432
433
433
#[ test]
434
- fn disabled_prefix_interpolation ( ) {
434
+ fn prefix_substitution_skipped_with_dot_slash ( ) {
435
435
let path = "./%(prefix)/foo/bar" ;
436
436
let git_install_dir = "/tmp/git" ;
437
437
assert_eq ! (
@@ -443,7 +443,7 @@ pub mod path {
443
443
}
444
444
445
445
#[ test]
446
- fn tilde_interpolated ( ) {
446
+ fn tilde_substitutes_current_user ( ) {
447
447
let path = & b"~/foo/bar" [ ..] ;
448
448
let expected = format ! (
449
449
"{}{}foo/bar" ,
@@ -459,16 +459,16 @@ pub mod path {
459
459
460
460
#[ cfg( target_os = "windows" ) ]
461
461
#[ test]
462
- fn user_interpolated ( ) {
462
+ fn tilde_with_given_user_is_unsupported_on_windows ( ) {
463
463
assert ! ( matches!(
464
464
Path :: from( Cow :: Borrowed ( & b"~baz/foo/bar" [ ..] ) ) . interpolate( None ) ,
465
- Err ( path :: interpolate :: Error :: UserInterpolationUnsupported )
465
+ Err ( Error :: UserInterpolationUnsupported )
466
466
) ) ;
467
467
}
468
468
469
469
#[ cfg( not( target_os = "windows" ) ) ]
470
470
#[ test]
471
- fn user_interpolated ( ) {
471
+ fn tilde_with_given_user ( ) {
472
472
let user = std:: env:: var ( "USER" ) . unwrap ( ) ;
473
473
let home = std:: env:: var ( "HOME" ) . unwrap ( ) ;
474
474
let specific_user_home = format ! ( "~{}" , user) ;
0 commit comments