nu-command 0.105.1

Nushell's built-in commands
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use nu_test_support::{nu, pipeline};

#[test]
fn filter_with_return_in_closure() {
    let actual = nu!(pipeline(
        "
        1..10 | filter { |it|
            if $it mod 2 == 0 {
                return true
            };
            return false;
        } | to nuon
        "
    ));

    assert_eq!(actual.out, "[2, 4, 6, 8, 10]");
    assert!(actual.err.contains("deprecated"));
}