mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Unit Tests
- Added tests for Tree::countTags.
This commit is contained in:
parent
d00c685699
commit
07a1f9d6b5
1 changed files with 3 additions and 1 deletions
|
@ -33,10 +33,11 @@ Context context;
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
int main (int argc, char** argv)
|
||||
{
|
||||
UnitTest ut (8);
|
||||
UnitTest ut (10);
|
||||
|
||||
// Construct tree as shown above.
|
||||
Tree t ("root");
|
||||
ut.is (t.countTags (), 0, "countTags == 0");
|
||||
|
||||
Tree* b = t.addBranch (new Tree ("c1"));
|
||||
b->attribute ("name", "c1");
|
||||
|
@ -59,6 +60,7 @@ int main (int argc, char** argv)
|
|||
|
||||
t._branches[2]->_branches[0]->tag ("one");
|
||||
t._branches[2]->_branches[0]->tag ("two");
|
||||
ut.is (t._branches[2]->_branches[0]->countTags (), 2, "countTags == 2");
|
||||
ut.ok (t._branches[2]->_branches[0]->hasTag ("one"), "hasTag +");
|
||||
ut.notok (t._branches[2]->_branches[0]->hasTag ("three"), "hasTag -");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue