Skip to content

Commit f318bb8

Browse files
committed
test: fix windows
1 parent ffc35a7 commit f318bb8

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

tests/usual_cli.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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
os_string_display::OsStringDisplay,
1313
reporter::{ErrorOnlyReporter, ErrorReport},
1414
visualizer::{BarAlignment, ColumnWidthDistribution, Direction, Visualizer},
@@ -17,6 +17,9 @@ use pipe_trait::Pipe;
1717
use pretty_assertions::assert_eq;
1818
use std::process::{Command, Stdio};
1919

20+
#[cfg(unix)]
21+
use parallel_disk_usage::get_size::{GetBlockCount, GetBlockSize};
22+
2023
fn stdio(command: Command) -> Command {
2124
command
2225
.with_stdin(Stdio::null())
@@ -443,7 +446,7 @@ fn bytes_format_plain() {
443446
let actual = Command::new(PDU)
444447
.with_current_dir(&workspace)
445448
.with_arg("--total-width=100")
446-
.with_arg("--quantity=block-size")
449+
.with_arg("--quantity=apparent-size")
447450
.with_arg("--bytes-format=plain")
448451
.pipe(stdio)
449452
.output()
@@ -453,7 +456,7 @@ fn bytes_format_plain() {
453456

454457
let builder = FsTreeBuilder {
455458
root: workspace.to_path_buf(),
456-
size_getter: GetBlockSize,
459+
size_getter: GetApparentSize,
457460
reporter: ErrorOnlyReporter::new(ErrorReport::SILENT),
458461
max_depth: 10,
459462
};
@@ -482,7 +485,7 @@ fn bytes_format_metric() {
482485
let actual = Command::new(PDU)
483486
.with_current_dir(&workspace)
484487
.with_arg("--total-width=100")
485-
.with_arg("--quantity=block-size")
488+
.with_arg("--quantity=apparent-size")
486489
.with_arg("--bytes-format=metric")
487490
.pipe(stdio)
488491
.output()
@@ -492,7 +495,7 @@ fn bytes_format_metric() {
492495

493496
let builder = FsTreeBuilder {
494497
root: workspace.to_path_buf(),
495-
size_getter: GetBlockSize,
498+
size_getter: GetApparentSize,
496499
reporter: ErrorOnlyReporter::new(ErrorReport::SILENT),
497500
max_depth: 10,
498501
};
@@ -521,7 +524,7 @@ fn bytes_format_binary() {
521524
let actual = Command::new(PDU)
522525
.with_current_dir(&workspace)
523526
.with_arg("--total-width=100")
524-
.with_arg("--quantity=block-size")
527+
.with_arg("--quantity=apparent-size")
525528
.with_arg("--bytes-format=binary")
526529
.pipe(stdio)
527530
.output()
@@ -531,7 +534,7 @@ fn bytes_format_binary() {
531534

532535
let builder = FsTreeBuilder {
533536
root: workspace.to_path_buf(),
534-
size_getter: GetBlockSize,
537+
size_getter: GetApparentSize,
535538
reporter: ErrorOnlyReporter::new(ErrorReport::SILENT),
536539
max_depth: 10,
537540
};

0 commit comments

Comments
 (0)