change display_error.exit_code to false (#13873)

The idea comes from @amtoine, I think it would be good to keey
`display_error.exit_code` same value, if user is using default config or
using no config file at all.
This commit is contained in:
Wind
2024-10-14 22:57:30 +08:00
committed by GitHub
parent a0f38f8845
commit 639bd4fc2e
3 changed files with 14 additions and 9 deletions

View File

@ -9,25 +9,28 @@ fn capture_errors_works() {
assert!(actual.err.contains("column_not_found"));
}
// TODO: need to add tests under display_error.exit_code = true
#[test]
fn capture_errors_works_for_external() {
let actual = nu!("do -c {nu --testbin fail}");
assert!(actual.err.contains("exited with code"));
assert_eq!(actual.out, "");
assert!(!actual.status.success());
assert!(!actual.err.contains("exited with code"));
}
// TODO: need to add tests under display_error.exit_code = true
#[test]
fn capture_errors_works_for_external_with_pipeline() {
let actual = nu!("do -c {nu --testbin fail} | echo `text`");
assert!(actual.err.contains("exited with code"));
assert_eq!(actual.out, "");
assert!(!actual.status.success());
assert!(!actual.err.contains("exited with code"));
}
// TODO: need to add tests under display_error.exit_code = true
#[test]
fn capture_errors_works_for_external_with_semicolon() {
let actual = nu!(r#"do -c {nu --testbin fail}; echo `text`"#);
assert!(actual.err.contains("exited with code"));
assert_eq!(actual.out, "");
assert!(!actual.status.success());
assert!(!actual.err.contains("exited with code"));
}
#[test]