forked from extern/nushell
Do a bit more cleanup of block params (#3455)
* Do a bit more cleanup of block params * Do a bit more cleanup of block params
This commit is contained in:
@ -379,17 +379,6 @@ fn proper_shadow_let_aliases() {
|
||||
assert_eq!(actual.out, "falsetruefalse");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn block_param_too_many() {
|
||||
let actual = nu!(
|
||||
cwd: ".",
|
||||
r#"
|
||||
[1, 2, 3] | each { |a, b| echo $a }
|
||||
"#
|
||||
);
|
||||
assert!(actual.err.contains("too many"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn block_params_override() {
|
||||
let actual = nu!(
|
||||
@ -401,6 +390,17 @@ fn block_params_override() {
|
||||
assert!(actual.err.contains("unknown variable"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn block_params_override_correct() {
|
||||
let actual = nu!(
|
||||
cwd: ".",
|
||||
r#"
|
||||
[1, 2, 3] | each { |a| echo $a } | to json
|
||||
"#
|
||||
);
|
||||
assert_eq!(actual.out, "[1,2,3]");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn run_dynamic_blocks() {
|
||||
let actual = nu!(
|
||||
|
Reference in New Issue
Block a user