serde: Add test for issue 446
This commit is contained in:
parent
5de8d3be5d
commit
2923f1066e
@ -65,6 +65,17 @@ mod tests {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn issue_446() {
|
||||||
|
let json = json!({ "timestamp": 15159743990000u64 });
|
||||||
|
|
||||||
|
assert_matches!(
|
||||||
|
serde_json::from_value::<SystemTimeTest>(json),
|
||||||
|
Ok(SystemTimeTest { timestamp })
|
||||||
|
if timestamp == UNIX_EPOCH + Duration::from_millis(15159743990000)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn serialize() {
|
fn serialize() {
|
||||||
let request = SystemTimeTest { timestamp: UNIX_EPOCH + Duration::new(2, 0) };
|
let request = SystemTimeTest { timestamp: UNIX_EPOCH + Duration::new(2, 0) };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user