adjust tests

This commit is contained in:
WindSoilder 2024-11-19 21:14:47 +08:00
parent e5bd992659
commit f11571c55d

View File

@ -44,7 +44,7 @@ fn do_with_semicolon_break_on_failed_external() {
fn ignore_shell_errors_works_for_external_with_semicolon() {
let actual = nu!(r#"do -s { open asdfasdf.txt }; "text""#);
assert_eq!(actual.err, "");
assert!(actual.err.contains("Deprecated option"));
assert_eq!(actual.out, "text");
}
@ -52,7 +52,7 @@ fn ignore_shell_errors_works_for_external_with_semicolon() {
fn ignore_program_errors_works_for_external_with_semicolon() {
let actual = nu!(r#"do -p { nu -n -c 'exit 1' }; "text""#);
assert_eq!(actual.err, "");
assert!(actual.err.contains("Deprecated option"));
assert_eq!(actual.out, "text");
}
@ -80,6 +80,7 @@ fn run_closure_with_it_using() {
#[test]
fn waits_for_external() {
let actual = nu!(r#"do -p { nu -c 'sleep 1sec; print before; exit 1'}; print after"#);
assert!(actual.err.is_empty());
assert!(actual.err.contains("Deprecated option"));
assert_eq!(actual.out, "beforeafter");
}