mirror of
https://github.com/nushell/nushell.git
synced 2025-04-26 06:08:21 +02:00
parent
e505e57a7a
commit
4e9c1067fb
@ -93,9 +93,12 @@ fn reject(
|
|||||||
let mut vals = vec![];
|
let mut vals = vec![];
|
||||||
|
|
||||||
for path in &keep_columns {
|
for path in &keep_columns {
|
||||||
let fetcher = input_val.clone().follow_cell_path(&path.members)?;
|
let fetcher = input_val.clone().follow_cell_path(&path.members);
|
||||||
cols.push(path.into_string());
|
|
||||||
vals.push(fetcher);
|
if let Ok(value) = fetcher {
|
||||||
|
cols.push(path.into_string());
|
||||||
|
vals.push(value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
output.push(Value::Record { cols, vals, span })
|
output.push(Value::Record { cols, vals, span })
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,14 @@ fn regular_columns() {
|
|||||||
assert_eq!(actual.out, "last_name, rusty_at");
|
assert_eq!(actual.out, "last_name, rusty_at");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn skip_cell_rejection() {
|
||||||
|
let actual = nu!(cwd: ".", pipeline(
|
||||||
|
r#"[ {a: 1, b: 2,c:txt}, { a:val } ] | reject a | get c.0"#));
|
||||||
|
|
||||||
|
assert_eq!(actual.out, "txt");
|
||||||
|
}
|
||||||
|
|
||||||
// FIXME: needs more work
|
// FIXME: needs more work
|
||||||
#[ignore]
|
#[ignore]
|
||||||
#[test]
|
#[test]
|
||||||
|
Loading…
Reference in New Issue
Block a user