#3298: reduce --numbered bug (#3354)

This commit is contained in:
Javier Goday
2021-04-27 09:07:56 +02:00
committed by GitHub
parent 77f42931ff
commit f9f74a0f7d
2 changed files with 26 additions and 1 deletions

View File

@ -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!(