mirror of
https://github.com/nushell/nushell.git
synced 2025-07-01 07:00:37 +02:00
Allow iteration blocks to have an optional extra index parameter (alternative to -n
flags) (#6994)
Alters `all`, `any`, `each while`, `each`, `insert`, `par-each`, `reduce`, `update`, `upsert` and `where`, so that their blocks take an optional parameter containing the index.
This commit is contained in:
@ -349,7 +349,7 @@ fn proper_missing_param() -> TestResult {
|
||||
|
||||
#[test]
|
||||
fn block_arity_check1() -> TestResult {
|
||||
fail_test(r#"ls | each { |x, y| 1}"#, "expected 1 block parameter")
|
||||
fail_test(r#"ls | each { |x, y, z| 1}"#, "expected 2 block parameters")
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
Reference in New Issue
Block a user