From 36392262331e33ea07dcb776efb28e6810e85585 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 29 Jun 2014 11:12:35 -0400 Subject: [PATCH] Unit Tests - Added tests for date parsing without the depletion requirement. --- test/date.t.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/date.t.cpp b/test/date.t.cpp index aebdb8588..319891b1c 100644 --- a/test/date.t.cpp +++ b/test/date.t.cpp @@ -36,7 +36,7 @@ Context context; //////////////////////////////////////////////////////////////////////////////// int main (int argc, char** argv) { - UnitTest t (208); + UnitTest t (210); // Ensure environment has no influence. unsetenv ("TASKDATA"); @@ -438,6 +438,13 @@ int main (int argc, char** argv) t.is (Date::length ("J"), 3, "length 'J' --> 3"); t.is (Date::length (" "), 1, "length ' ' --> 1"); + + // Depletion requirement. + Date r30 ("Mon Jun 30 2014", "a b D Y", false, false, true); + t.is (r30.toString ("YMDHNS"), "20140630000000", "Depletion required on complex format with spaces"); + + Date r31 ("Mon Jun 30 2014 xxx", "a b D Y", false, false, false); + t.is (r31.toString ("YMDHNS"), "20140630000000", "Depletion not required on complex format with spaces"); } catch (const std::string& e)