mirror of
https://github.com/nushell/nushell.git
synced 2025-08-15 13:23:15 +02:00
Better error handling using do
(#5890)
* adds `capture-errors` flag for `do` * adds `get-type` core command to get type * fmt * add tests in example * fmt * fix tests * manually revert previous changes related to `get-type` * adds method to check for error name using `into string` * fix clippy
This commit is contained in:
13
crates/nu-command/tests/commands/do_.rs
Normal file
13
crates/nu-command/tests/commands/do_.rs
Normal file
@ -0,0 +1,13 @@
|
||||
use nu_test_support::{nu, pipeline};
|
||||
|
||||
#[test]
|
||||
fn capture_errors_works() {
|
||||
let actual = nu!(
|
||||
cwd: ".", pipeline(
|
||||
r#"
|
||||
do -c {$env.use} | describe
|
||||
"#
|
||||
));
|
||||
|
||||
assert_eq!(actual.out, "error");
|
||||
}
|
Reference in New Issue
Block a user