mirror of
https://github.com/nushell/nushell
synced 2024-12-31 23:39:00 +00:00
6f59167960
* make semicolon works with some internal command like do * refactor, make consume external result logic out of eval_external * update comment
25 lines
449 B
Rust
25 lines
449 B
Rust
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");
|
|
}
|
|
|
|
#[test]
|
|
fn do_with_semicolon_break_on_failed_external() {
|
|
let actual = nu!(
|
|
cwd: ".", pipeline(
|
|
r#"
|
|
do { nu --not_exist_flag }; `text`
|
|
"#
|
|
));
|
|
|
|
assert_eq!(actual.out, "");
|
|
}
|