Improve duration math and printing (#1748)

* Improve duration math and printing

* Fix test
This commit is contained in:
Jonathan Turner
2020-05-11 13:44:49 +12:00
committed by GitHub
parent 8951a01e58
commit a2e9bbd358
3 changed files with 35 additions and 0 deletions

View File

@ -96,6 +96,18 @@ fn parens_precedence() {
assert_eq!(actual.out, "12");
}
#[test]
fn duration_math() {
let actual = nu!(
cwd: "tests/fixtures/formats", pipeline(
r#"
= 1w + 1d
"#
));
assert_eq!(actual.out, "8:00:00:00");
}
#[test]
fn compound_comparison() {
let actual = nu!(