mirror of
https://github.com/nushell/nushell.git
synced 2025-08-18 17:08:34 +02:00
Loops return external stream when external command failed. (#8646)
This commit is contained in:
@@ -28,3 +28,27 @@ fn for_break_on_external_failed() {
|
||||
// so our output will be `1`
|
||||
assert_eq!(actual.out, "1");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn failed_for_should_break_running() {
|
||||
let actual = nu!(
|
||||
cwd: ".",
|
||||
r#"
|
||||
for i in 1..2 {
|
||||
nu --testbin fail
|
||||
}
|
||||
print 3"#
|
||||
);
|
||||
assert!(!actual.out.contains('3'));
|
||||
|
||||
let actual = nu!(
|
||||
cwd: ".",
|
||||
r#"
|
||||
let x = [1 2]
|
||||
for i in $x {
|
||||
nu --testbin fail
|
||||
}
|
||||
print 3"#
|
||||
);
|
||||
assert!(!actual.out.contains('3'));
|
||||
}
|
||||
|
Reference in New Issue
Block a user