nushell/crates/nu-command/tests/commands/do_.rs
WindSoilder 6f59167960
Make semicolon works better for internal commands (#6643)
* make semicolon works with some internal command like do

* refactor, make consume external result logic out of eval_external

* update comment
2022-09-30 07:13:46 -05:00

26 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, "");
}