mirror of
https://github.com/bootandy/dust.git
synced 2025-12-05 20:40:11 -08:00
Compare commits
2 Commits
76b9f32859
...
3cce61f854
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3cce61f854 | ||
|
|
222cd83ff3 |
@@ -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()
|
||||
@@ -46,9 +45,9 @@ pub fn get_biggest(
|
||||
|
||||
let nodes = handle_duplicate_top_level_names(top_level_nodes, display_data.short_paths);
|
||||
root = total_node_builder(size, nodes);
|
||||
heap = always_add_children(&display_data, &root, heap);
|
||||
} else {
|
||||
root = top_level_nodes.into_iter().next().unwrap();
|
||||
}
|
||||
heap = add_children(&display_data, &root, heap);
|
||||
}
|
||||
|
||||
|
||||
@@ -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