@@ -1263,7 +1263,7 @@ mod tests {
1263
1263
let exp = $exp;
1264
1264
let res = parse_prefix( path) ;
1265
1265
assert!( res == exp,
1266
- "parse_prefix(\" %s \" ): expected %? , found %? " , path, exp, res) ;
1266
+ "parse_prefix(\" {} \" ): expected {:?} , found {:?} " , path, exp, res) ;
1267
1267
}
1268
1268
)
1269
1269
)
@@ -1809,11 +1809,11 @@ mod tests {
1809
1809
let file = p. pop_str( ) ;
1810
1810
let left = $left;
1811
1811
assert!( p. as_str( ) == Some ( left) ,
1812
- "`%s `.pop() failed; expected remainder `%s `, found `%s `" ,
1812
+ "`{} `.pop() failed; expected remainder `{} `, found `{} `" ,
1813
1813
pstr, left, p. as_str( ) . unwrap( ) ) ;
1814
1814
let right = $right;
1815
1815
let res = file. map( |s| s. as_slice( ) ) ;
1816
- assert!( res == right, "`%s `.pop() failed; expected `%? `, found `%? `" ,
1816
+ assert!( res == right, "`{} `.pop() failed; expected `{:?} `, found `{:?} `" ,
1817
1817
pstr, right, res) ;
1818
1818
}
1819
1819
) ;
@@ -1965,7 +1965,7 @@ mod tests {
1965
1965
let res = path.$op(arg);
1966
1966
let exp = $res;
1967
1967
assert!(res.as_str() == Some(exp),
1968
- " `%s` . %s ( \" %s \" ) : Expected `%s `, found `%s `",
1968
+ " `{ } ` . { } ( \" { } \" ) : Expected `{ } `, found `{ } `",
1969
1969
pstr, stringify!( $op) , arg, exp, res. as_str( ) . unwrap( ) ) ;
1970
1970
}
1971
1971
)
@@ -2201,19 +2201,19 @@ mod tests {
2201
2201
let path = $path;
2202
2202
let filename = $filename;
2203
2203
assert!( path. filename_str( ) == filename,
2204
- "`%s `.filename_str(): Expected `%? `, found `%? `" ,
2204
+ "`{} `.filename_str(): Expected `{:?} `, found `{:?} `" ,
2205
2205
path. as_str( ) . unwrap( ) , filename, path. filename_str( ) ) ;
2206
2206
let dirname = $dirname;
2207
2207
assert!( path. dirname_str( ) == dirname,
2208
- "`%s `.dirname_str(): Expected `%? `, found `%? `" ,
2208
+ "`{} `.dirname_str(): Expected `{:?} `, found `{:?} `" ,
2209
2209
path. as_str( ) . unwrap( ) , dirname, path. dirname_str( ) ) ;
2210
2210
let filestem = $filestem;
2211
2211
assert!( path. filestem_str( ) == filestem,
2212
- "`%s `.filestem_str(): Expected `%? `, found `%? `" ,
2212
+ "`{} `.filestem_str(): Expected `{:?} `, found `{:?} `" ,
2213
2213
path. as_str( ) . unwrap( ) , filestem, path. filestem_str( ) ) ;
2214
2214
let ext = $ext;
2215
2215
assert!( path. extension_str( ) == ext,
2216
- "`%s `.extension_str(): Expected `%? `, found `%? `" ,
2216
+ "`{} `.extension_str(): Expected `{:?} `, found `{:?} `" ,
2217
2217
path. as_str( ) . unwrap( ) , ext, path. extension_str( ) ) ;
2218
2218
}
2219
2219
) ;
@@ -2284,16 +2284,16 @@ mod tests {
2284
2284
let path = Path :: from_str( $path) ;
2285
2285
let ( abs, vol, cwd, rel) = ( $abs, $vol, $cwd, $rel) ;
2286
2286
let b = path. is_absolute( ) ;
2287
- assert!( b == abs, "Path '%s '.is_absolute(): expected %? , found %? " ,
2287
+ assert!( b == abs, "Path '{} '.is_absolute(): expected {:?} , found {:?} " ,
2288
2288
path. as_str( ) . unwrap( ) , abs, b) ;
2289
2289
let b = path. is_vol_relative( ) ;
2290
- assert!( b == vol, "Path '%s '.is_vol_relative(): expected %? , found %? " ,
2290
+ assert!( b == vol, "Path '{} '.is_vol_relative(): expected {:?} , found {:?} " ,
2291
2291
path. as_str( ) . unwrap( ) , vol, b) ;
2292
2292
let b = path. is_cwd_relative( ) ;
2293
- assert!( b == cwd, "Path '%s '.is_cwd_relative(): expected %? , found %? " ,
2293
+ assert!( b == cwd, "Path '{} '.is_cwd_relative(): expected {:?} , found {:?} " ,
2294
2294
path. as_str( ) . unwrap( ) , cwd, b) ;
2295
2295
let b = path. is_relative( ) ;
2296
- assert!( b == rel, "Path '%s '.is_relativf(): expected %? , found %? " ,
2296
+ assert!( b == rel, "Path '{} '.is_relativf(): expected {:?} , found {:?} " ,
2297
2297
path. as_str( ) . unwrap( ) , rel, b) ;
2298
2298
}
2299
2299
)
@@ -2326,7 +2326,7 @@ mod tests {
2326
2326
let exp = $exp;
2327
2327
let res = path. is_ancestor_of( & dest) ;
2328
2328
assert!( res == exp,
2329
- "`%s `.is_ancestor_of(`%s `): Expected %? , found %? " ,
2329
+ "`{} `.is_ancestor_of(`{} `): Expected {:?} , found {:?} " ,
2330
2330
path. as_str( ) . unwrap( ) , dest. as_str( ) . unwrap( ) , exp, res) ;
2331
2331
}
2332
2332
)
@@ -2461,7 +2461,7 @@ mod tests {
2461
2461
let res = path. path_relative_from( & other) ;
2462
2462
let exp = $exp;
2463
2463
assert!( res. and_then_ref( |x| x. as_str( ) ) == exp,
2464
- "`%s `.path_relative_from(`%s `): Expected %? , got %? " ,
2464
+ "`{} `.path_relative_from(`{} `): Expected {:?} , got {:?} " ,
2465
2465
path. as_str( ) . unwrap( ) , other. as_str( ) . unwrap( ) , exp,
2466
2466
res. and_then_ref( |x| x. as_str( ) ) ) ;
2467
2467
}
@@ -2593,12 +2593,13 @@ mod tests {
2593
2593
let path = Path :: from_str( $path) ;
2594
2594
let comps = path. str_component_iter( ) . map( |x|x. unwrap( ) ) . to_owned_vec( ) ;
2595
2595
let exp: & [ & str ] = $exp;
2596
- assert!( comps. as_slice( ) == exp, "str_component_iter: Expected %?, found %?" ,
2596
+ assert!( comps. as_slice( ) == exp,
2597
+ "str_component_iter: Expected {:?}, found {:?}" ,
2597
2598
comps. as_slice( ) , exp) ;
2598
2599
let comps = path. rev_str_component_iter( ) . map( |x|x. unwrap( ) ) . to_owned_vec( ) ;
2599
2600
let exp = exp. rev_iter( ) . map( |& x|x) . to_owned_vec( ) ;
2600
2601
assert!( comps. as_slice( ) == exp,
2601
- "rev_str_component_iter: Expected %? , found %? " ,
2602
+ "rev_str_component_iter: Expected {:?} , found {:?} " ,
2602
2603
comps. as_slice( ) , exp) ;
2603
2604
}
2604
2605
) ;
@@ -2607,12 +2608,13 @@ mod tests {
2607
2608
let path = Path :: from_vec( b!( $( $arg) , +) ) ;
2608
2609
let comps = path. str_component_iter( ) . map( |x|x. unwrap( ) ) . to_owned_vec( ) ;
2609
2610
let exp: & [ & str ] = $exp;
2610
- assert!( comps. as_slice( ) == exp, "str_component_iter: Expected %?, found %?" ,
2611
+ assert!( comps. as_slice( ) == exp,
2612
+ "str_component_iter: Expected {:?}, found {:?}" ,
2611
2613
comps. as_slice( ) , exp) ;
2612
2614
let comps = path. rev_str_component_iter( ) . map( |x|x. unwrap( ) ) . to_owned_vec( ) ;
2613
2615
let exp = exp. rev_iter( ) . map( |& x|x) . to_owned_vec( ) ;
2614
2616
assert!( comps. as_slice( ) == exp,
2615
- "rev_str_component_iter: Expected %? , found %? " ,
2617
+ "rev_str_component_iter: Expected {:?} , found {:?} " ,
2616
2618
comps. as_slice( ) , exp) ;
2617
2619
}
2618
2620
)
@@ -2666,11 +2668,12 @@ mod tests {
2666
2668
let path = Path :: from_str( $path) ;
2667
2669
let comps = path. component_iter( ) . to_owned_vec( ) ;
2668
2670
let exp: & [ & [ u8 ] ] = $exp;
2669
- assert!( comps. as_slice( ) == exp, "component_iter: Expected %? , found %? " ,
2671
+ assert!( comps. as_slice( ) == exp, "component_iter: Expected {:?} , found {:?} " ,
2670
2672
comps. as_slice( ) , exp) ;
2671
2673
let comps = path. rev_component_iter( ) . to_owned_vec( ) ;
2672
2674
let exp = exp. rev_iter( ) . map( |& x|x) . to_owned_vec( ) ;
2673
- assert!( comps. as_slice( ) == exp, "rev_component_iter: Expected %?, found %?" ,
2675
+ assert!( comps. as_slice( ) == exp,
2676
+ "rev_component_iter: Expected {:?}, found {:?}" ,
2674
2677
comps. as_slice( ) , exp) ;
2675
2678
}
2676
2679
)
0 commit comments