nushell/tests/shell/pipeline/mod.rs
Ian Manske f03ba6793e
Fix non-zero exit code errors in middle of pipeline (#13899)
# Description
Fixes #13868. Should come after #13885.

# User-Facing Changes
Bug fix.

# Tests + Formatting
Added a test.
2024-10-02 06:04:18 -05:00

19 lines
494 B
Rust

mod commands;
use nu_test_support::nu;
use pretty_assertions::assert_eq;
#[test]
fn doesnt_break_on_utf8() {
let actual = nu!("echo ö");
assert_eq!(actual.out, "ö", "'{}' should contain ö", actual.out);
}
#[test]
fn non_zero_exit_code_in_middle_of_pipeline_ignored() {
let actual = nu!("nu -c 'print a b; exit 42' | collect");
assert_eq!(actual.out, "ab");
let actual = nu!("nu -c 'print a b; exit 42' | nu --stdin -c 'collect'");
assert_eq!(actual.out, "ab");
}