It-expansion fixes (#1757)

* It-expansion fixes

* fix clippy
This commit is contained in:
Jonathan Turner
2020-05-12 15:58:16 +12:00
committed by GitHub
parent 8b9a8daa1d
commit c3535b5c67
5 changed files with 49 additions and 6 deletions

View File

@ -51,3 +51,15 @@ fn cal_rows_in_2020() {
assert!(actual.out.contains("62"));
}
#[test]
fn cal_sees_pipeline_year() {
let actual = nu!(
cwd: ".", pipeline(
r#"
echo 1020 | cal --full-year $it | get monday | first 3 | to json
"#
));
assert_eq!(actual.out, "[3,10,17]");
}

View File

@ -108,6 +108,18 @@ fn duration_math() {
assert_eq!(actual.out, "8:00:00:00");
}
#[test]
fn it_math() {
let actual = nu!(
cwd: "tests/fixtures/formats", pipeline(
r#"
echo 1020 | = $it + 10
"#
));
assert_eq!(actual.out, "1030");
}
#[test]
fn compound_comparison() {
let actual = nu!(