Fixed $in in where blocks (#6976)

This commit is contained in:
Leon
2022-11-10 08:05:15 +10:00
committed by GitHub
parent c600c1ebe7
commit 2c238aea6a
13 changed files with 103 additions and 1 deletions

View File

@ -22,6 +22,36 @@ fn filters_with_nothing_comparison() {
assert_eq!(actual.out, "7");
}
#[test]
fn filters_with_0_arity_block() {
let actual = nu!(
cwd: ".",
"[1 2 3 4] | where { $in < 3 } | to nuon"
);
assert_eq!(actual.out, "[1, 2]");
}
#[test]
fn filters_with_1_arity_block() {
let actual = nu!(
cwd: ".",
"[1 2 3 6 7 8] | where {|e| $e < 5 } | to nuon"
);
assert_eq!(actual.out, "[1, 2, 3]");
}
#[test]
fn unique_env_each_iteration() {
let actual = nu!(
cwd: "tests/fixtures/formats",
"[1 2] | where { print ($env.PWD | str ends-with 'formats') | cd '/' | true } | to nuon"
);
assert_eq!(actual.out, "truetrue[1, 2]");
}
#[test]
fn where_in_table() {
let actual = nu!(