mirror of
https://github.com/bootandy/dust.git
synced 2025-12-05 20:40:11 -08:00
tests: add test for d0
Test to stop bug in previous commit occuring Also cargo clippy
This commit is contained in:
@@ -32,8 +32,7 @@ pub fn get_biggest(
|
||||
|
||||
if number_top_level_nodes == 0 {
|
||||
root = total_node_builder(0, vec![])
|
||||
} else {
|
||||
if number_top_level_nodes > 1 {
|
||||
} else if number_top_level_nodes > 1 {
|
||||
let size = if by_filetime.is_some() {
|
||||
top_level_nodes
|
||||
.iter()
|
||||
@@ -51,7 +50,6 @@ pub fn get_biggest(
|
||||
root = top_level_nodes.into_iter().next().unwrap();
|
||||
heap = add_children(&display_data, &root, heap);
|
||||
}
|
||||
}
|
||||
|
||||
fill_remaining_lines(heap, &root, display_data, keep_collapsed)
|
||||
}
|
||||
|
||||
@@ -62,6 +62,14 @@ pub fn test_d_flag_works() {
|
||||
assert!(!output.contains("hello_file"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
pub fn test_d0_works_on_multiple() {
|
||||
// We should see the top level directory but not the sub dirs / files:
|
||||
let output = build_command(vec!["-d", "0", "tests/test_dir/", "tests/test_dir2"]);
|
||||
assert!(output.contains("test_dir "));
|
||||
assert!(output.contains("test_dir2"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
pub fn test_threads_flag_works() {
|
||||
let output = build_command(vec!["-T", "1", "tests/test_dir/"]);
|
||||
|
||||
Reference in New Issue
Block a user