Columnpath support when passing fields for formatting. (#1472)

This commit is contained in:
Andrés N. Robalino
2020-03-10 01:55:03 -05:00
committed by GitHub
parent 54bf671a50
commit db16b56fe1
4 changed files with 76 additions and 23 deletions

View File

@ -14,3 +14,17 @@ fn creates_the_resulting_string_from_the_given_fields() {
assert_eq!(actual, "nu has license ISC");
}
#[test]
fn given_fields_can_be_column_paths() {
let actual = nu!(
cwd: "tests/fixtures/formats", pipeline(
r#"
open cargo_sample.toml
| format "{package.name} is {package.description}"
| echo $it
"#
));
assert_eq!(actual, "nu is a new type of shell");
}

View File

@ -42,6 +42,6 @@ fn writes_out_csv() {
);
let actual = file_contents(expected_file);
assert!(actual.contains("[Table],A shell for the GitHub era,2018,ISC,nu,0.1.1"));
assert!(actual.contains("[Table],a new type of shell,2018,ISC,nu,0.1.1"));
})
}