mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 21:07:58 +02:00
Pipeline blocks (#1579)
* Making Commands match what UntaggedValue needs * WIP * WIP * WIP * Moved to expressions for conditions * Add 'each' command to use command blocks * More cleanup * Add test for 'each' * Instead use an expression block
This commit is contained in:
13
crates/nu-cli/tests/commands/each.rs
Normal file
13
crates/nu-cli/tests/commands/each.rs
Normal file
@ -0,0 +1,13 @@
|
||||
use nu_test_support::{nu, pipeline};
|
||||
|
||||
#[test]
|
||||
fn each_works_separately() {
|
||||
let actual = nu!(
|
||||
cwd: "tests/fixtures/formats", pipeline(
|
||||
r#"
|
||||
echo [1 2 3] | each { echo $it 10 | sum } | to-json | echo $it
|
||||
"#
|
||||
));
|
||||
|
||||
assert_eq!(actual, "[11,12,13]");
|
||||
}
|
@ -4,6 +4,7 @@ mod cd;
|
||||
mod compact;
|
||||
mod cp;
|
||||
mod default;
|
||||
mod each;
|
||||
mod edit;
|
||||
mod enter;
|
||||
mod first;
|
||||
|
Reference in New Issue
Block a user