Allow for rejecting nested record cells (#6463)

* add new function to remove data at a cellpath; allow reject to use cellpath

* add tests

* fmt

* fix clippt

* get it working properly with lists of records

* fix clippy, hopefully

* fix clippy, hopefully 2
This commit is contained in:
pwygab
2022-09-03 20:35:36 +08:00
committed by GitHub
parent 4656310a1c
commit e81689f2c0
3 changed files with 179 additions and 138 deletions

View File

@ -107,3 +107,16 @@ fn reject_table_from_raw_eval() {
assert!(actual.out.contains("record 0 fields"));
}
#[test]
fn reject_nested_field() {
let actual = nu!(
cwd: ".", pipeline(
r#"
{a:{b:3,c:5}} | reject a.b | debug
"#
)
);
assert_eq!(actual.out, "{a: {c: 5}}");
}