From b92350ef6a37fd5e388b77e7eef202878d964922 Mon Sep 17 00:00:00 2001 From: dfhoughton Date: Sat, 5 Jan 2019 16:20:29 -0500 Subject: made space optional before era suffix --- tests/tests.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests') diff --git a/tests/tests.rs b/tests/tests.rs index 31ef9fb..c77eb1a 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -851,6 +851,24 @@ fn april_3_25_ad() { assert_eq!(d2, end); } +#[test] +fn april_3_25bc() { + let d1 = NaiveDate::from_ymd(-24, 4, 3).and_hms(0, 0, 0); + let d2 = d1 + Duration::days(1); + let (start, end, _) = parse("April 3, 25BC", None).unwrap(); + assert_eq!(d1, start); + assert_eq!(d2, end); +} + +#[test] +fn april_3_25ad() { + let d1 = NaiveDate::from_ymd(25, 4, 3).and_hms(0, 0, 0); + let d2 = d1 + Duration::days(1); + let (start, end, _) = parse("April 3, 25AD", None).unwrap(); + assert_eq!(d1, start); + assert_eq!(d2, end); +} + #[test] fn this_weekend() { let now = NaiveDate::from_ymd(1969, 5, 6).and_hms(0, 0, 0); -- cgit v1.2.3