mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 06:30:08 +02:00
Make Semicolon stop on error (#6079)
* introduce external command runs to failed error, and implement semicolon relative logic * ignore test due to semicolon works * not raise ShellError for external commands * update comment * add relative test in for windows * fix type-o Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
This commit is contained in:
@ -123,6 +123,21 @@ fn double_quote_does_not_expand_path_glob() {
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
#[test]
|
||||
fn failed_command_with_semicolon_will_not_execute_following_cmds() {
|
||||
Playground::setup("external failed command with semicolon", |dirs, _| {
|
||||
let actual = nu!(
|
||||
cwd: dirs.test(), pipeline(
|
||||
r#"
|
||||
^ls *.abc; echo done
|
||||
"#
|
||||
));
|
||||
|
||||
assert!(!actual.out.contains("done"));
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
#[test]
|
||||
fn explicit_glob_windows() {
|
||||
@ -166,6 +181,21 @@ fn bare_word_expand_path_glob_windows() {
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
#[test]
|
||||
fn failed_command_with_semicolon_will_not_execute_following_cmds_windows() {
|
||||
Playground::setup("external failed command with semicolon", |dirs, _| {
|
||||
let actual = nu!(
|
||||
cwd: dirs.test(), pipeline(
|
||||
r#"
|
||||
^cargo asdf; echo done
|
||||
"#
|
||||
));
|
||||
|
||||
assert!(!actual.out.contains("done"));
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
#[test]
|
||||
// This test case might fail based on the running shell on Windows - CMD vs PowerShell, the reason is
|
||||
|
Reference in New Issue
Block a user