let format access variables also (#1842)

This commit is contained in:
Jonathan Turner
2020-05-18 21:20:09 -07:00
committed by GitHub
parent 76b170cea0
commit b89976daef
5 changed files with 40 additions and 61 deletions

View File

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