default to $nothing if cellpath not found (#6535)

* default to  if cellpath not found

* fmt

* add test

* fix test

* fix clippy

* move behaviour behind `-i` flag

* prevent any possibility of an unspanned error

* ignore all errors

* seperate testes

* fmt
This commit is contained in:
pwygab
2022-09-13 21:17:16 +08:00
committed by GitHub
parent df6a7b6f5c
commit 12a0fe39f7
3 changed files with 52 additions and 5 deletions

View File

@ -159,3 +159,27 @@ fn selects_many_rows() {
assert_eq!(actual.out, "2");
});
}
#[test]
fn select_ignores_errors_succesfully1() {
let actual = nu!(
cwd: ".", pipeline(
r#"
[{a: 1, b: 2} {a: 3, b: 5} {a: 3}] | select -i b
"#
));
assert!(actual.err.is_empty());
}
#[test]
fn select_ignores_errors_succesfully2() {
let actual = nu!(
cwd: ".", pipeline(
r#"
[{a: 1} {a: 2} {a: 3}] | select -i b
"#
));
assert!(actual.err.is_empty());
}