fixed some more tests (#4607)

This commit is contained in:
Darren Schroeder
2022-02-22 10:32:29 -06:00
committed by GitHub
parent 25712760ba
commit f507613b38
11 changed files with 18 additions and 60 deletions

View File

@ -5,25 +5,13 @@ use nu_test_support::{nu, pipeline};
const ZIP_POWERED_TEST_ASSERTION_SCRIPT: &str = r#"
def expect [
left,
right,
--to-eq
--to-eq,
right
] {
$left | zip { $right } | all? {
$it.name.0 == $it.name.1 && $it.commits.0 == $it.commits.1
$left | zip { $right } | all? {|row|
$row.name.0 == $row.name.1 && $row.commits.0 == $row.commits.1
}
}
def add-commits [n] {
each {
let contributor = $it;
let name = $it.name;
let commits = $it.commits;
$contributor | merge {
[[commits]; [($commits + $n)]]
}
}
}
"#;
// FIXME: jt: needs more work
@ -48,7 +36,7 @@ fn zips_two_tables() {
[ jt, 20]
]);
let actual = ($contributors | add-commits 10);
let actual = ($contributors | update commits {{ |i| ($i.commits + 10) }});
expect $actual --to-eq [[name, commits]; [andres, 20] [jt, 30]]
"#,