@@ -212,41 +212,45 @@ fn test_du_soft_link() {
212212 return ;
213213 }
214214 }
215- du_soft_link ( result. stdout_str ( ) ) ;
216- }
217215
218- #[ cfg( target_vendor = "apple" ) ]
219- fn du_soft_link ( s : & str ) {
220- // 'macos' host variants may have `du` output variation for soft links
221- assert ! ( ( s == "12\t subdir/links\n " ) || ( s == "16\t subdir/links\n " ) ) ;
222- }
223- #[ cfg( target_os = "windows" ) ]
224- fn du_soft_link ( s : & str ) {
225- assert_eq ! ( s, "8\t subdir/links\n " ) ;
226- }
227- #[ cfg( target_os = "freebsd" ) ]
228- fn du_soft_link ( s : & str ) {
229- // FreeBSD may have different block allocations depending on filesystem
230- // Accept both common sizes
231- let valid_sizes = [ "12\t subdir/links\n " , "16\t subdir/links\n " ] ;
232- assert ! (
233- valid_sizes. contains( & s) ,
234- "Expected one of {:?}, got {}" ,
235- valid_sizes,
236- s
237- ) ;
238- }
239- #[ cfg( all(
240- not( target_vendor = "apple" ) ,
241- not( target_os = "windows" ) ,
242- not( target_os = "freebsd" )
243- ) ) ]
244- fn du_soft_link ( s : & str ) {
245- // MS-WSL linux has altered expected output
246- if uucore:: os:: is_wsl_1 ( ) {
216+ let s = result. stdout_str ( ) ;
217+ println ! ( "Output: {s}" ) ;
218+ #[ cfg( target_vendor = "apple" ) ]
219+ {
220+ // 'macos' host variants may have `du` output variation for soft links
221+ assert ! ( ( s == "12\t subdir/links\n " ) || ( s == "16\t subdir/links\n " ) ) ;
222+ }
223+
224+ #[ cfg( target_os = "windows" ) ]
225+ {
247226 assert_eq ! ( s, "8\t subdir/links\n " ) ;
248- } else {
249- assert_eq ! ( s, "16\t subdir/links\n " ) ;
227+ }
228+
229+ #[ cfg( target_os = "freebsd" ) ]
230+ {
231+ // FreeBSD may have different block allocations depending on filesystem
232+ // Accept both common sizes
233+ let valid_sizes = [ "12\t subdir/links\n " , "16\t subdir/links\n " ] ;
234+ assert ! (
235+ valid_sizes. contains( & s) ,
236+ "Expected one of {:?}, got {}" ,
237+ valid_sizes,
238+ s
239+ ) ;
240+ }
241+
242+ #[ cfg( all(
243+ not( target_vendor = "apple" ) ,
244+ not( target_os = "windows" ) ,
245+ not( target_os = "freebsd" )
246+ ) ) ]
247+ {
248+ // MS-WSL linux has altered expected output
249+ if uucore:: os:: is_wsl_1 ( ) {
250+ assert_eq ! ( s, "8\t subdir/links\n " ) ;
251+ } else {
252+ assert_eq ! ( s, "16\t subdir/links\n " ) ;
253+ }
250254 }
251255}
252256
0 commit comments