Fix missing invocation errors (#1846)

This commit is contained in:
Chris Pearce 2020-05-20 00:57:25 +12:00 committed by GitHub
parent b89976daef
commit ae87582cb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

@ -198,6 +198,10 @@ async fn evaluate_invocation(
let output = result.into_vec().await;
if let Some(e) = context.get_errors().get(0) {
return Err(e.clone());
}
match output.len() {
x if x > 1 => Ok(UntaggedValue::Table(output).into_value(Tag::unknown())),
1 => Ok(output[0].clone()),

View File

@ -100,6 +100,16 @@ fn invocation_handles_dot() {
})
}
#[test]
fn argument_invocation_reports_errors() {
let actual = nu!(
cwd: ".",
"echo $(ferris_is_not_here.exe)"
);
assert!(actual.err.contains("Command not found"));
}
#[test]
fn can_process_one_row_from_internal_and_pipes_it_to_stdin_of_external() {
let actual = nu!(