From 12661b4bde298b44a3b93ebaa31e0d3910ba70f1 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 26 Sep 2015 21:59:12 -0400 Subject: [PATCH] Test: Added more ISO8601d tests --- test/iso8601d.t.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/iso8601d.t.cpp b/test/iso8601d.t.cpp index d9b4f60e1..d896f3ebd 100644 --- a/test/iso8601d.t.cpp +++ b/test/iso8601d.t.cpp @@ -71,7 +71,7 @@ void testParse ( //////////////////////////////////////////////////////////////////////////////// int main (int argc, char** argv) { - UnitTest t (848); + UnitTest t (850); ISO8601d iso; std::string::size_type start = 0; @@ -314,6 +314,11 @@ int main (int argc, char** argv) t.is (d, 1, "1/1/2008 == 1"); t.is (y, 2008, "1/1/2008 == 2008"); + ISO8601d epoch (9, 8, 2001); + t.ok ((int)epoch.toEpoch () < 1000000000, "9/8/2001 < 1,000,000,000"); + epoch += 172800; + t.ok ((int)epoch.toEpoch () > 1000000000, "9/10/2001 > 1,000,000,000"); + // int ISO8601d::length (const std::string&); t.is (ISO8601d::length ("m"), 2, "length 'm' --> 2"); t.is (ISO8601d::length ("M"), 2, "length 'M' --> 2");