mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 14:40:06 +02:00
@ -61,6 +61,21 @@ fn reduce_numbered_example() {
|
||||
assert_eq!(actual.out, "1");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn reduce_numbered_integer_addition_example() {
|
||||
let actual = nu!(
|
||||
cwd: ".", pipeline(
|
||||
r#"
|
||||
echo [1 2 3 4]
|
||||
| reduce -n {= $acc.item + $it.item }
|
||||
| get item
|
||||
"#
|
||||
)
|
||||
);
|
||||
|
||||
assert_eq!(actual.out, "10");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn folding_with_tables() {
|
||||
let actual = nu!(
|
||||
|
Reference in New Issue
Block a user