forked from extern/nushell
Fix cell path when getting columns of non-records (#7508)
A follow-up to #7497. That change made it so that `get foo` would eliminate non-record rows; I think that was an unintentional and undesirable side-effect. Before #7497: ```bash 〉[$nothing, { item: "foo" }] | get item ╭───┬─────╮ │ 0 │ │ │ 1 │ foo │ ╰───┴─────╯ ``` After #7497: ```bash 〉[$nothing, {item: "foo"}] | get item ╭───┬─────╮ │ 0 │ foo │ ╰───┴─────╯ ``` After this PR: ```bash 〉[$nothing, { item: "foo" }] | get item ╭───┬─────╮ │ 0 │ │ │ 1 │ foo │ ╰───┴─────╯ ``` cc: @merelymyself
This commit is contained in:
@ -179,7 +179,7 @@ fn parses_json() {
|
||||
fn parses_xml() {
|
||||
let actual = nu!(
|
||||
cwd: "tests/fixtures/formats",
|
||||
"open jonathan.xml | get rss.children.channel.children | get 0.item.children | get 0.link.children.0.0"
|
||||
"open jonathan.xml | get rss.children.channel.children | get 0.item.children | get 3.link.children.3.0"
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
|
Reference in New Issue
Block a user