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:
JT
2021-05-21 19:04:27 +12:00
committed by GitHub
parent 28388b4e3a
commit 751de20f93
15 changed files with 157 additions and 186 deletions

View File

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