mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 19:07:42 +02:00
1747 add ns to duration (#2128)
* Added nanos to Duration * Removed unwraps * Added nanos to Duration * Removed unwraps * Fixed errors * Removed unwraps * Changed serialization to String * Fixed Date and Duration comparison
This commit is contained in:
committed by
GitHub
parent
6a89b1b010
commit
e07a9e4ee7
@ -168,7 +168,31 @@ fn duration_math() {
|
||||
"#
|
||||
));
|
||||
|
||||
assert_eq!(actual.out, "8:00:00:00");
|
||||
assert_eq!(actual.out, "8:00:00:00.0");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn duration_math_with_nanoseconds() {
|
||||
let actual = nu!(
|
||||
cwd: "tests/fixtures/formats", pipeline(
|
||||
r#"
|
||||
= 1w + 10ns
|
||||
"#
|
||||
));
|
||||
|
||||
assert_eq!(actual.out, "7:00:00:00.00000001");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn duration_math_with_negative() {
|
||||
let actual = nu!(
|
||||
cwd: "tests/fixtures/formats", pipeline(
|
||||
r#"
|
||||
= 1d - 1w
|
||||
"#
|
||||
));
|
||||
|
||||
assert_eq!(actual.out, "-6:00:00:00.0");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
Reference in New Issue
Block a user