mirror of
https://github.com/nushell/nushell.git
synced 2024-11-23 00:43:33 +01:00
25 lines
483 B
Rust
25 lines
483 B
Rust
|
use nu_test_support::{nu, pipeline};
|
||
|
|
||
|
// Inside nu! stdout is piped so it won't be a terminal
|
||
|
#[test]
|
||
|
fn is_terminal_stdout_piped() {
|
||
|
let actual = nu!(pipeline(
|
||
|
r#"
|
||
|
is-terminal --stdout
|
||
|
"#
|
||
|
));
|
||
|
|
||
|
assert_eq!(actual.out, "false");
|
||
|
}
|
||
|
|
||
|
#[test]
|
||
|
fn is_terminal_two_streams() {
|
||
|
let actual = nu!(pipeline(
|
||
|
r#"
|
||
|
is-terminal --stdin --stderr
|
||
|
"#
|
||
|
));
|
||
|
|
||
|
assert!(actual.err.contains("Only one stream may be checked"));
|
||
|
}
|