mirror of
https://github.com/nushell/nushell
synced 2025-01-07 18:59:04 +00:00
7304d06c0b
In particular, one thing that we can't (properly) do before this commit is consuming an infinite input stream. For example: ``` yes | grep y | head -n10 ``` will give 10 "y"s in most shells, but blocks indefinitely in nu. This PR resolves that by doing blocking I/O in threads, and reducing the `await` calls we currently have in our pipeline code.
16 lines
381 B
Rust
16 lines
381 B
Rust
use nu_test_support::nu;
|
|
use nu_test_support::playground::Playground;
|
|
|
|
#[test]
|
|
fn creates_a_file_when_it_doesnt_exist() {
|
|
Playground::setup("create_test_1", |dirs, _sandbox| {
|
|
nu!(
|
|
cwd: dirs.test(),
|
|
"touch i_will_be_created.txt"
|
|
);
|
|
|
|
let path = dirs.test().join("i_will_be_created.txt");
|
|
|
|
assert!(path.exists());
|
|
})
|
|
}
|