Skip to content

Commit dcf5f96

Browse files
committed
Some improvements in tests
Signed-off-by: Malhar Vora <mlvora.2010@gmail.com>
1 parent 89d00aa commit dcf5f96

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

src/uu/kill/src/kill.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use clap::{Arg, ArgAction, Command, crate_version, value_parser};
99
use uucore::libc;
1010
#[cfg(target_os = "linux")]
11-
#[cfg(target_os = "linux")]
1211
use uucore::{error::UResult, format_usage, help_about, help_usage};
1312

1413
const ABOUT: &str = help_about!("kill.md");

tests/by-util/test_kill.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ fn test_non_numerical_pid() {
1818
let stdout = res.stdout_str();
1919
let stderr = res.stderr_str();
2020

21-
assert!(stdout.trim().len() == 0);
21+
assert!(stdout.trim().is_empty());
2222
assert!(stderr.contains("invalid value 'xyz'"));
2323
}
2424

@@ -32,6 +32,6 @@ fn test_pid_doesnt_exist() {
3232
let stderr = res.stderr_str();
3333
let error_msg = format!("bash: kill: ({non_existent_pid}) - No such process");
3434

35-
assert!(stdout.trim().len() == 0);
35+
assert!(stdout.trim().is_empty());
3636
assert!(stderr.contains(error_msg.as_str()));
3737
}

0 commit comments

Comments
 (0)