2023-12-16 16:07:08 +01:00
|
|
|
use nu_test_support::nu;
|
|
|
|
|
|
|
|
#[test]
|
2024-01-03 14:22:43 +01:00
|
|
|
fn basic_stdout() {
|
|
|
|
let without_complete = nu!(r#"
|
|
|
|
nu --testbin cococo test
|
|
|
|
"#);
|
|
|
|
let with_complete = nu!(r#"
|
|
|
|
(nu --testbin cococo test | complete).stdout
|
|
|
|
"#);
|
|
|
|
|
|
|
|
assert_eq!(with_complete.out, without_complete.out);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn basic_exit_code() {
|
|
|
|
let with_complete = nu!(r#"
|
|
|
|
(nu --testbin cococo test | complete).exit_code
|
2023-12-16 16:07:08 +01:00
|
|
|
"#);
|
|
|
|
|
2024-01-03 14:22:43 +01:00
|
|
|
assert_eq!(with_complete.out, "0");
|
2023-12-16 16:07:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn error() {
|
|
|
|
let actual = nu!("do { not-found } | complete");
|
|
|
|
|
|
|
|
assert!(actual.err.contains("executable was not found"));
|
|
|
|
}
|