Compare commits

..

1 Commits

Author SHA1 Message Date
andy.boot
f2cef68dfd tests: add test for d0
Test to stop bug in previous commit occuring
Also cargo clippy
2025-07-28 22:20:37 +01:00
5 changed files with 16 additions and 22 deletions

2
Cargo.lock generated
View File

@@ -322,7 +322,7 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10"
[[package]]
name = "du-dust"
version = "1.2.3"
version = "1.2.2"
dependencies = [
"ansi_term",
"assert_cmd",

View File

@@ -1,7 +1,7 @@
[package]
name = "du-dust"
description = "A more intuitive version of du"
version = "1.2.3"
version = "1.2.2"
authors = ["bootandy <bootandy@gmail.com>", "nebkor <code@ardent.nebcorp.com>"]
edition = "2024"
readme = "README.md"

View File

@@ -1,6 +1,6 @@
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.TH Dust 1 "Dust 1.2.3"
.TH Dust 1 "Dust 1.2.2"
.SH NAME
Dust \- Like du but more intuitive
.SH SYNOPSIS
@@ -167,4 +167,4 @@ Print version
[\fIPATH\fR]
Input files or directories
.SH VERSION
v1.2.3
v1.2.2

View File

@@ -307,21 +307,16 @@ fn main() {
indicator.stop();
let print_errors = config.get_print_errors(&options);
let final_errors = walk_data.errors.lock().unwrap();
print_any_errors(print_errors, &final_errors);
print_any_errors(print_errors, walk_data.errors);
if tree.children.is_empty() && !final_errors.file_not_found.is_empty() {
std::process::exit(1)
} else {
print_output(
config,
options,
tree,
walk_data.by_filecount,
is_colors,
terminal_width,
)
}
print_output(
config,
options,
tree,
walk_data.by_filecount,
is_colors,
terminal_width,
)
});
}
@@ -362,7 +357,8 @@ fn print_output(
}
}
fn print_any_errors(print_errors: bool, final_errors: &RuntimeErrors) {
fn print_any_errors(print_errors: bool, errors: Arc<Mutex<RuntimeErrors>>) {
let final_errors = errors.lock().unwrap();
if !final_errors.file_not_found.is_empty() {
let err = final_errors
.file_not_found

View File

@@ -107,9 +107,7 @@ pub fn test_ignore_all_in_file() {
#[test]
pub fn test_with_bad_param() {
let mut cmd = Command::cargo_bin("dust").unwrap();
cmd.arg("-P").arg("bad_place");
let output_error = cmd.unwrap_err();
let result = output_error.as_output().unwrap();
let result = cmd.arg("bad_place").unwrap();
let stderr = str::from_utf8(&result.stderr).unwrap();
assert!(stderr.contains("No such file or directory"));
}