mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-29 17:07:19 +02:00
Unit Tests - Task::validate
- Implemented first (of many) Task::validate tests.
This commit is contained in:
parent
652f9b3c0a
commit
b7a0883212
1 changed files with 7 additions and 1 deletions
|
@ -32,7 +32,7 @@ Context context;
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
int main (int argc, char** argv)
|
||||
{
|
||||
UnitTest test (36);
|
||||
UnitTest test (37);
|
||||
|
||||
test.is ((int)Task::textToStatus ("pending"), (int)Task::pending, "textToStatus pending");
|
||||
test.is ((int)Task::textToStatus ("completed"), (int)Task::completed, "textToStatus completed");
|
||||
|
@ -153,6 +153,12 @@ TODO Task::*Annotation*
|
|||
left.set ("one", "1.0");
|
||||
test.notok (left == right, "left == right -> false");
|
||||
|
||||
// Task::validate
|
||||
Task bad ("[entry:1000000001 start:1000000000]");
|
||||
good = true;
|
||||
try { bad.validate (); } catch (...) { good = false; }
|
||||
test.notok (good, "Task::validate entry <= start");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue