Test: Added more ISO8601d tests

This commit is contained in:
Paul Beckingham 2015-09-26 21:43:58 -04:00
parent 2b31994ce0
commit 843e49e2bc

View file

@ -71,7 +71,7 @@ void testParse (
////////////////////////////////////////////////////////////////////////////////
int main (int argc, char** argv)
{
UnitTest t (828);
UnitTest t (840);
ISO8601d iso;
std::string::size_type start = 0;
@ -221,6 +221,25 @@ int main (int argc, char** argv)
ISO8601d now;
t.ok (now.toISO ().find ("1969") == std::string::npos, "'now' != 1969");
ISO8601d yesterday;
yesterday -= 86400;
ISO8601d tomorrow;
tomorrow += 86400;
t.ok (yesterday <= now, "yesterday <= now");
t.ok (yesterday < now, "yesterday < now");
t.notok (yesterday == now, "!(yesterday == now)");
t.ok (yesterday != now, "yesterday != now");
t.ok (now >= yesterday, "now >= yesterday");
t.ok (now > yesterday, "now > yesterday");
t.ok (tomorrow >= now, "tomorrow >= now");
t.ok (tomorrow > now, "tomorrow > now");
t.notok (tomorrow == now, "!(tomorrow == now)");
t.ok (tomorrow != now, "tomorrow != now");
t.ok (now <= tomorrow, "now <= tomorrow");
t.ok (now < tomorrow, "now < tomorrow");
// Leap year.
t.ok (ISO8601d::leapYear (2008), "2008 is a leap year");
t.notok (ISO8601d::leapYear (2007), "2007 is not a leap year");