mirror of
https://github.com/nushell/nushell
synced 2024-12-28 14:03:09 +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
|
//FIXME: improve implementation to not clone
|
||||||
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());
|
cols.push(path.into_string().replace('.', "_"));
|
||||||
vals.push(fetcher);
|
vals.push(fetcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,11 +150,11 @@ fn select(
|
||||||
//FIXME: improve implementation to not clone
|
//FIXME: improve implementation to not clone
|
||||||
match x.clone().follow_cell_path(&path.members) {
|
match x.clone().follow_cell_path(&path.members) {
|
||||||
Ok(value) => {
|
Ok(value) => {
|
||||||
cols.push(path.into_string());
|
cols.push(path.into_string().replace('.', "_"));
|
||||||
vals.push(value);
|
vals.push(value);
|
||||||
}
|
}
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
cols.push(path.into_string());
|
cols.push(path.into_string().replace('.', "_"));
|
||||||
vals.push(Value::Nothing { span });
|
vals.push(Value::Nothing { span });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -175,7 +175,7 @@ fn select(
|
||||||
// FIXME: remove clone
|
// FIXME: remove clone
|
||||||
let result = v.clone().follow_cell_path(&cell_path.members)?;
|
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);
|
vals.push(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,8 +22,6 @@ fn regular_columns() {
|
||||||
assert_eq!(actual.out, "Robalino");
|
assert_eq!(actual.out, "Robalino");
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: jt: needs more work
|
|
||||||
#[ignore]
|
|
||||||
#[test]
|
#[test]
|
||||||
fn complex_nested_columns() {
|
fn complex_nested_columns() {
|
||||||
Playground::setup("select_test_2", |dirs, sandbox| {
|
Playground::setup("select_test_2", |dirs, sandbox| {
|
||||||
|
@ -57,8 +55,9 @@ fn complex_nested_columns() {
|
||||||
r#"
|
r#"
|
||||||
open los_tres_caballeros.json
|
open los_tres_caballeros.json
|
||||||
| select nu."0xATYKARNU" nu.committers.name nu.releases.version
|
| select nu."0xATYKARNU" nu.committers.name nu.releases.version
|
||||||
| where nu_releases_version > "0.8"
|
|
||||||
| get nu_releases_version
|
| get nu_releases_version
|
||||||
|
| where $it > "0.8"
|
||||||
|
| get 0
|
||||||
"#
|
"#
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue