Skip to content

Commit b3d4187

Browse files
committed
add regression tests
1 parent c528cb1 commit b3d4187

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

prost-types/src/datetime.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,16 @@ mod tests {
771771
"2020-06-15 00:01:02.123 +0800".parse::<Timestamp>(),
772772
Timestamp::date_time_nanos(2020, 6, 14, 16, 1, 2, 123_000_000),
773773
);
774+
775+
// Regression tests
776+
assert_eq!(
777+
"-11111111-z".parse::<Timestamp>(),
778+
Err(crate::TimestampError::ParseFailure),
779+
);
780+
assert_eq!(
781+
"1900-01-10".parse::<Timestamp>(),
782+
Ok(Timestamp{seconds: -2208211200, nanos: 0}),
783+
);
774784
}
775785

776786
#[test]

0 commit comments

Comments
 (0)