-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
Test:
/// Test for https://github.com/tc39/proposal-temporal/pull/3172/
///
/// test262: built-ins/Temporal/Duration/prototype/total/rounding-window
#[test]
#[cfg(feature = "compiled_data")]
fn test_nudge_relative_date_total() {
let d = Duration::new(1, 0, 0, 0, 1, 0, 0, 0, 0, 0).unwrap();
let relative = PlainDate::new(2020, 2, 29, Calendar::ISO).unwrap();
assert_eq!(d.total(Unit::Year, Some(relative.into())).unwrap(), 1.0001141552511414);
let d = Duration::new(0, 1, 0, 0, 10, 0, 0, 0, 0, 0).unwrap();
let relative = PlainDate::new(2020, 1, 31, Calendar::ISO).unwrap();
assert_eq!(d.total(Unit::Month, Some(relative.into())).unwrap(), 1.0134408602150538);
}(a similar test can be written based on the round test in test262)
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
No status