mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-21 07:43:08 +02:00
Unit Tests
- Added tests for date parsing with and without depletion.
This commit is contained in:
parent
0c0e36993d
commit
e17dd13afd
1 changed files with 5 additions and 3 deletions
|
@ -36,7 +36,7 @@ Context context;
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
int main (int argc, char** argv)
|
||||
{
|
||||
UnitTest t (210);
|
||||
UnitTest t (211);
|
||||
|
||||
// Ensure environment has no influence.
|
||||
unsetenv ("TASKDATA");
|
||||
|
@ -440,11 +440,13 @@ int main (int argc, char** argv)
|
|||
t.is (Date::length (" "), 1, "length ' ' --> 1");
|
||||
|
||||
// Depletion requirement.
|
||||
Date r30 ("Mon Jun 30 2014", "a b D Y", false, false, true);
|
||||
Date r30 ("Mon Jun 30 2014", "a b D Y", false, false);
|
||||
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);
|
||||
std::string::size_type i = 0;
|
||||
Date r31 ("Mon Jun 30 2014 xxx", i, "a b D Y", false, false);
|
||||
t.is (r31.toString ("YMDHNS"), "20140630000000", "Depletion not required on complex format with spaces");
|
||||
t.is ((int)i, 15, "Depletion not required on complex format with spaces, 15 chars");
|
||||
}
|
||||
|
||||
catch (const std::string& e)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue