Fix access to columns with quoted names (#1662)

This commit is contained in:
Jonathan Turner
2020-04-26 18:01:55 +12:00
committed by GitHub
parent ad7a3fd908
commit df90d9e4b6
2 changed files with 16 additions and 45 deletions

View File

@ -235,3 +235,13 @@ fn errors_fetching_by_index_out_of_bounds() {
)
})
}
#[test]
fn quoted_column_access() {
let actual = nu!(
cwd: "tests/fixtures/formats",
r#"echo '[{"foo bar": {"baz": 4}}]' | from-json | get "foo bar".baz | echo $it"#
);
assert_eq!(actual, "4");
}