mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 14:40:06 +02:00
Return error when kill
didn't terminate successfully (#6354)
* Return error when `kill` didn't terminate successfully Signed-off-by: nibon7 <nibon7@163.com> * add test Signed-off-by: nibon7 <nibon7@163.com> Signed-off-by: nibon7 <nibon7@163.com>
This commit is contained in:
@ -48,6 +48,7 @@ mod open;
|
||||
mod p;
|
||||
mod parse;
|
||||
mod path;
|
||||
mod platform;
|
||||
mod prepend;
|
||||
mod print;
|
||||
#[cfg(feature = "database")]
|
||||
|
9
crates/nu-command/tests/commands/platform/kill.rs
Normal file
9
crates/nu-command/tests/commands/platform/kill.rs
Normal file
@ -0,0 +1,9 @@
|
||||
use nu_test_support::nu;
|
||||
|
||||
#[test]
|
||||
fn test_kill_invalid_pid() {
|
||||
let pid = i32::MAX;
|
||||
let actual = nu!(format!("kill {}", pid));
|
||||
|
||||
assert!(actual.err.contains("process didn't terminate successfully"));
|
||||
}
|
1
crates/nu-command/tests/commands/platform/mod.rs
Normal file
1
crates/nu-command/tests/commands/platform/mod.rs
Normal file
@ -0,0 +1 @@
|
||||
mod kill;
|
Reference in New Issue
Block a user