mirror of
https://github.com/nushell/nushell
synced 2024-12-29 14:33:13 +00:00
84caf8859f
* Refactor: make stdout write all and flush as generic function * support print to stderr
23 lines
480 B
Rust
23 lines
480 B
Rust
use nu_test_support::{nu, pipeline};
|
|
|
|
#[test]
|
|
fn print_to_stdout() {
|
|
let actual = nu!(
|
|
cwd: ".", pipeline(
|
|
"print 'hello world'"
|
|
)
|
|
);
|
|
assert!(actual.out.contains("hello world"));
|
|
assert!(actual.err.is_empty());
|
|
}
|
|
|
|
#[test]
|
|
fn print_to_stderr() {
|
|
let actual = nu!(
|
|
cwd: ".", pipeline(
|
|
"print -e 'hello world'"
|
|
)
|
|
);
|
|
assert!(actual.out.is_empty());
|
|
assert!(actual.err.contains("hello world"));
|
|
}
|