mirror of
https://github.com/nushell/nushell
synced 2024-12-27 05:23:11 +00:00
fix select tests (#5577)
This commit is contained in:
parent
bb079608dd
commit
7d9a77f179
2 changed files with 6 additions and 7 deletions
|
@ -126,7 +126,7 @@ fn select(
|
|||
//FIXME: improve implementation to not clone
|
||||
let fetcher = input_val.clone().follow_cell_path(&path.members)?;
|
||||
|
||||
cols.push(path.into_string());
|
||||
cols.push(path.into_string().replace('.', "_"));
|
||||
vals.push(fetcher);
|
||||
}
|
||||
|
||||
|
@ -150,11 +150,11 @@ fn select(
|
|||
//FIXME: improve implementation to not clone
|
||||
match x.clone().follow_cell_path(&path.members) {
|
||||
Ok(value) => {
|
||||
cols.push(path.into_string());
|
||||
cols.push(path.into_string().replace('.', "_"));
|
||||
vals.push(value);
|
||||
}
|
||||
Err(_) => {
|
||||
cols.push(path.into_string());
|
||||
cols.push(path.into_string().replace('.', "_"));
|
||||
vals.push(Value::Nothing { span });
|
||||
}
|
||||
}
|
||||
|
@ -175,7 +175,7 @@ fn select(
|
|||
// FIXME: remove clone
|
||||
let result = v.clone().follow_cell_path(&cell_path.members)?;
|
||||
|
||||
cols.push(cell_path.into_string());
|
||||
cols.push(cell_path.into_string().replace('.', "_"));
|
||||
vals.push(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -22,8 +22,6 @@ fn regular_columns() {
|
|||
assert_eq!(actual.out, "Robalino");
|
||||
}
|
||||
|
||||
// FIXME: jt: needs more work
|
||||
#[ignore]
|
||||
#[test]
|
||||
fn complex_nested_columns() {
|
||||
Playground::setup("select_test_2", |dirs, sandbox| {
|
||||
|
@ -57,8 +55,9 @@ fn complex_nested_columns() {
|
|||
r#"
|
||||
open los_tres_caballeros.json
|
||||
| select nu."0xATYKARNU" nu.committers.name nu.releases.version
|
||||
| where nu_releases_version > "0.8"
|
||||
| get nu_releases_version
|
||||
| where $it > "0.8"
|
||||
| get 0
|
||||
"#
|
||||
));
|
||||
|
||||
|
|
Loading…
Reference in a new issue