test(where): test for possible regression after closure support

This commit is contained in:
Bahex 2025-05-06 12:11:46 +03:00
parent ac36b4a247
commit 50e360d898

View File

@ -28,6 +28,12 @@ fn where_inside_block_works() {
assert_eq!(actual.out, "closure"); assert_eq!(actual.out, "closure");
} }
#[test]
fn it_inside_complex_subexpression() {
let actual = nu!(r#"1..10 | where [($it * $it)].0 > 40 | to nuon"#);
assert_eq!(actual.out, r#"[7, 8, 9, 10]"#)
}
#[test] #[test]
fn filters_with_0_arity_block() { fn filters_with_0_arity_block() {
let actual = nu!("[1 2 3 4] | where {|| $in < 3 } | to nuon"); let actual = nu!("[1 2 3 4] | where {|| $in < 3 } | to nuon");