Skip to content

Commit e76bce1

Browse files
committed
test: fix
1 parent d5949dc commit e76bce1

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

tests/usual_cli.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ fn max_depth_2() {
191191
root: workspace.to_path_buf(),
192192
size_getter: GetApparentSize,
193193
reporter: ErrorOnlyReporter::new(ErrorReport::SILENT),
194-
max_depth: 10,
194+
max_depth: 2,
195195
};
196196
let mut data_tree: DataTree<OsStringDisplay, _> = builder.into();
197197
data_tree.par_cull_insignificant_data(0.01);
@@ -229,7 +229,7 @@ fn max_depth_1() {
229229
root: workspace.to_path_buf(),
230230
size_getter: GetApparentSize,
231231
reporter: ErrorOnlyReporter::new(ErrorReport::SILENT),
232-
max_depth: 10,
232+
max_depth: 1,
233233
};
234234
let mut data_tree: DataTree<OsStringDisplay, _> = builder.into();
235235
data_tree.par_cull_insignificant_data(0.01);

tests/visualizer.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use parallel_disk_usage::{
77
visualizer::{BarAlignment, ColumnWidthDistribution, Direction, Visualizer},
88
};
99
use pretty_assertions::assert_eq;
10-
use std::{cmp::Ordering, num::NonZeroUsize};
10+
use std::cmp::Ordering;
1111
use text_block_macros::text_block_fnl;
1212
use zero_copy_pads::Width;
1313

@@ -33,10 +33,10 @@ macro_rules! test_case {
3333
$(#[$attributes])*
3434
#[test]
3535
fn $name() {
36-
let tree = $tree;
36+
let mut tree = $tree;
3737
let column_width_distribution =
3838
ColumnWidthDistribution::$column_width_function($($column_width_arguments),+);
39-
let _max_depth = NonZeroUsize::new($max_depth).expect("non-zero max_depth"); // TODO: remove later
39+
tree.par_retain(|_, depth| depth + 1 < $max_depth);
4040
let actual = Visualizer {
4141
column_width_distribution,
4242
data_tree: &tree,

0 commit comments

Comments
 (0)