Add named positionals to all (#3863)

This commit is contained in:
JT
2021-07-30 09:12:24 +12:00
committed by GitHub
parent 9c016ad479
commit f3e487e829
2 changed files with 33 additions and 1 deletions

View File

@ -19,6 +19,34 @@ fn checks_all_rows_are_true() {
})
}
#[test]
fn checks_all_rows_are_false_with_param() {
Playground::setup("all_test_1", |_, nu| {
assert_that!(
nu.pipeline(&input(
r#"
[1, 2, 3, 4] | all? { |a| $a >= 5 }
"#
)),
says().stdout("false")
);
})
}
#[test]
fn checks_all_rows_are_true_with_param() {
Playground::setup("all_test_1", |_, nu| {
assert_that!(
nu.pipeline(&input(
r#"
[1, 2, 3, 4] | all? { |a| $a < 5 }
"#
)),
says().stdout("true")
);
})
}
#[test]
fn checks_all_columns_of_a_table_is_true() {
Playground::setup("any_test_1", |_, nu| {