mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Test: Added more ISO8601d tests
This commit is contained in:
parent
2b31994ce0
commit
843e49e2bc
1 changed files with 20 additions and 1 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue