From 0a4850fb333b6f7140c2cb3246745b161cce3096 Mon Sep 17 00:00:00 2001 From: Bastien Dejean Date: Wed, 1 Apr 2020 09:58:13 +0200 Subject: [PATCH] Add asserts for the encoded values --- src/time.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/time.rs b/src/time.rs index 72aef46..69fec60 100644 --- a/src/time.rs +++ b/src/time.rs @@ -167,7 +167,9 @@ mod tests { month: 7, day: 23 }; - assert_eq!(d, Date::decode(d.encode())); + let x = d.encode(); + assert_eq!(x, 38647); + assert_eq!(d, Date::decode(x)); } #[test] @@ -189,6 +191,9 @@ mod tests { let (x1, y1) = t1.encode(); let (x2, y2) = t2.encode(); let (x3, y3) = t3.encode(); + assert_eq!((x1, y1), (30830, 199)); + assert_eq!((x2, y2), (30825, 99)); + assert_eq!((x3, y3), (30830, 104)); assert_eq!(t1, Time::decode(x1, y1)); assert_eq!(t2, Time::decode(x2, y2)); assert_eq!(t3, Time::decode(x3, y3));