@@ -8,7 +8,7 @@ use parallel_disk_usage::{
88 bytes_format:: BytesFormat ,
99 data_tree:: DataTree ,
1010 fs_tree_builder:: FsTreeBuilder ,
11- get_size:: { GetApparentSize , GetBlockCount , GetBlockSize } ,
11+ get_size:: GetApparentSize ,
1212 hardlink:: HardlinkIgnorant ,
1313 os_string_display:: OsStringDisplay ,
1414 reporter:: { ErrorOnlyReporter , ErrorReport } ,
@@ -18,6 +18,9 @@ use pipe_trait::Pipe;
1818use pretty_assertions:: assert_eq;
1919use std:: process:: { Command , Stdio } ;
2020
21+ #[ cfg( unix) ]
22+ use parallel_disk_usage:: get_size:: { GetBlockCount , GetBlockSize } ;
23+
2124fn stdio ( command : Command ) -> Command {
2225 command
2326 . with_stdin ( Stdio :: null ( ) )
@@ -448,14 +451,13 @@ fn quantity_block_count() {
448451 assert_eq ! ( actual, expected) ;
449452}
450453
451- #[ cfg( unix) ]
452454#[ test]
453455fn bytes_format_plain ( ) {
454456 let workspace = SampleWorkspace :: default ( ) ;
455457 let actual = Command :: new ( PDU )
456458 . with_current_dir ( & workspace)
457459 . with_arg ( "--total-width=100" )
458- . with_arg ( "--quantity=block -size" )
460+ . with_arg ( "--quantity=apparent -size" )
459461 . with_arg ( "--bytes-format=plain" )
460462 . pipe ( stdio)
461463 . output ( )
@@ -465,7 +467,7 @@ fn bytes_format_plain() {
465467
466468 let builder = FsTreeBuilder {
467469 root : workspace. to_path_buf ( ) ,
468- size_getter : GetBlockSize ,
470+ size_getter : GetApparentSize ,
469471 hardlinks_recorder : & HardlinkIgnorant ,
470472 reporter : & ErrorOnlyReporter :: new ( ErrorReport :: SILENT ) ,
471473 max_depth : 10 ,
@@ -488,14 +490,13 @@ fn bytes_format_plain() {
488490 assert_eq ! ( actual, expected) ;
489491}
490492
491- #[ cfg( unix) ]
492493#[ test]
493494fn bytes_format_metric ( ) {
494495 let workspace = SampleWorkspace :: default ( ) ;
495496 let actual = Command :: new ( PDU )
496497 . with_current_dir ( & workspace)
497498 . with_arg ( "--total-width=100" )
498- . with_arg ( "--quantity=block -size" )
499+ . with_arg ( "--quantity=apparent -size" )
499500 . with_arg ( "--bytes-format=metric" )
500501 . pipe ( stdio)
501502 . output ( )
@@ -505,7 +506,7 @@ fn bytes_format_metric() {
505506
506507 let builder = FsTreeBuilder {
507508 root : workspace. to_path_buf ( ) ,
508- size_getter : GetBlockSize ,
509+ size_getter : GetApparentSize ,
509510 hardlinks_recorder : & HardlinkIgnorant ,
510511 reporter : & ErrorOnlyReporter :: new ( ErrorReport :: SILENT ) ,
511512 max_depth : 10 ,
@@ -528,14 +529,13 @@ fn bytes_format_metric() {
528529 assert_eq ! ( actual, expected) ;
529530}
530531
531- #[ cfg( unix) ]
532532#[ test]
533533fn bytes_format_binary ( ) {
534534 let workspace = SampleWorkspace :: default ( ) ;
535535 let actual = Command :: new ( PDU )
536536 . with_current_dir ( & workspace)
537537 . with_arg ( "--total-width=100" )
538- . with_arg ( "--quantity=block -size" )
538+ . with_arg ( "--quantity=apparent -size" )
539539 . with_arg ( "--bytes-format=binary" )
540540 . pipe ( stdio)
541541 . output ( )
@@ -545,7 +545,7 @@ fn bytes_format_binary() {
545545
546546 let builder = FsTreeBuilder {
547547 root : workspace. to_path_buf ( ) ,
548- size_getter : GetBlockSize ,
548+ size_getter : GetApparentSize ,
549549 hardlinks_recorder : & HardlinkIgnorant ,
550550 reporter : & ErrorOnlyReporter :: new ( ErrorReport :: SILENT ) ,
551551 max_depth : 10 ,
0 commit comments