mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 22:50:14 +02:00
Fixed $in in where
blocks (#6976)
This commit is contained in:
@ -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!(
|
||||
|
Reference in New Issue
Block a user