2023-07-17 16:43:51 +00:00
|
|
|
use nu_test_support::nu;
|
2022-07-02 14:54:49 +00:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn print_to_stdout() {
|
2023-07-17 16:43:51 +00:00
|
|
|
let actual = nu!("print 'hello world'");
|
2022-07-02 14:54:49 +00:00
|
|
|
assert!(actual.out.contains("hello world"));
|
|
|
|
assert!(actual.err.is_empty());
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn print_to_stderr() {
|
2023-07-17 16:43:51 +00:00
|
|
|
let actual = nu!("print -e 'hello world'");
|
2022-07-02 14:54:49 +00:00
|
|
|
assert!(actual.out.is_empty());
|
|
|
|
assert!(actual.err.contains("hello world"));
|
|
|
|
}
|
2024-08-12 09:29:25 +00:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn print_raw() {
|
|
|
|
let actual = nu!("0x[41 42 43] | print --raw");
|
|
|
|
assert_eq!(actual.out, "ABC");
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn print_raw_stream() {
|
|
|
|
let actual = nu!("[0x[66] 0x[6f 6f]] | bytes collect | print --raw");
|
|
|
|
assert_eq!(actual.out, "foo");
|
|
|
|
}
|