1
0
mirror of https://github.com/nushell/nushell.git synced 2025-04-22 04:08:20 +02:00
nushell/crates/nu-command/tests/commands/complete.rs
Andrej Kolchin 020e121391
Bubble up errors passed to complete ()
Errors passed in `PipelineData::Value` get thrown in `complete` now.

Also added two simple tests for the command.

Fix 
Fix 
2023-12-16 09:07:08 -06:00

18 lines
322 B
Rust

use nu_test_support::nu;
#[test]
fn basic() {
let actual = nu!(r#"
(^echo a | complete) == {stdout: "a\n", exit_code: 0}
"#);
assert_eq!(actual.out, "true");
}
#[test]
fn error() {
let actual = nu!("do { not-found } | complete");
assert!(actual.err.contains("executable was not found"));
}