mirror of
https://github.com/nushell/nushell.git
synced 2024-12-26 08:59:12 +01:00
18ddf95d44
# Description Fixes: #11996 After this change `let t = timeit ^ls` will list current directory to stdout. ``` ❯ let t = timeit ^ls CODE_OF_CONDUCT.md Cargo.lock Cross.toml README.md aaa benches devdocs here11 scripts target toolkit.nu wix CONTRIBUTING.md Cargo.toml LICENSE a.txt assets crates docker rust-toolchain.toml src tests typos.toml ``` If user don't want such behavior, he can redirect the stdout to `std null-stream` easily ``` > use std > let t = timeit { ^ls o> (std null-device) } ``` # User-Facing Changes NaN # Tests + Formatting Done # After Submitting Nan --------- Co-authored-by: Ian Manske <ian.manske@pm.me>
15 lines
413 B
Rust
15 lines
413 B
Rust
use nu_test_support::nu;
|
|
|
|
#[test]
|
|
fn timeit_show_stdout() {
|
|
let actual = nu!("let t = timeit nu --testbin cococo abcdefg");
|
|
assert_eq!(actual.out, "abcdefg");
|
|
}
|
|
|
|
#[test]
|
|
fn timeit_show_stderr() {
|
|
let actual = nu!(" with-env {FOO: bar, FOO2: baz} { let t = timeit { nu --testbin echo_env_mixed out-err FOO FOO2 } }");
|
|
assert!(actual.out.contains("bar"));
|
|
assert!(actual.err.contains("baz"));
|
|
}
|