diff --git a/PUNCHLIST b/PUNCHLIST index 8818a564c..c07c39239 100644 --- a/PUNCHLIST +++ b/PUNCHLIST @@ -4,7 +4,6 @@ Beta1 Punch List - Working merge command - task.1 man page that is accurate - taskrc.5 man page that is accurate -- 42 or fewer failing unit tests (arbitrary non-zero number) Beta 2/3 Punch List - Task server integration diff --git a/src/helpers.cpp b/src/helpers.cpp index b49333030..510c145c5 100644 --- a/src/helpers.cpp +++ b/src/helpers.cpp @@ -133,7 +133,6 @@ std::string onProjectChange (Task& task, bool scope /* = true */) // Count pending and done tasks, for this project. int count_pending = 0; int count_done = 0; - std::vector all = context.tdb2.all_tasks (); countTasks (all, project, count_pending, count_done); @@ -197,6 +196,8 @@ static void countTasks ( ++count_done; break; + case Task::deleted: + case Task::recurring: default: break; } diff --git a/test/bug.605.t b/test/bug.605.t index 27c9cef69..b82178e67 100755 --- a/test/bug.605.t +++ b/test/bug.605.t @@ -28,7 +28,7 @@ use strict; use warnings; -use Test::More tests => 6; +use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'bug.rc') @@ -43,22 +43,23 @@ if (open my $fh, '>', 'bug.rc') # Setup: Add a task and complete it qx{../src/task rc:bug.rc add One project:p1}; -# Delete the task and note the completion status of the project -my $output = qx{echo '-- y' | ../src/task rc:bug.rc 1 del}; -like ($output, qr/is 100\% complete/ms, 'Empty project correctly reported as being 100% completed.'); +# Delete the task and note the completion status of the project. +my $output = qx{echo '-- y' | ../src/task rc:bug.rc 1 delete}; +like ($output, qr/is 0\% complete/ms, 'Empty project correctly reported as being 0% completed.'); + +# Add another task, complete it and note the completion status of hte project. +qx{../src/task rc:bug.rc add Two project:p1}; +$output = qx{../src/task rc:bug.rc 2 done}; +like ($output, qr/is 100\% complete/ms, 'Empty project correctly reported as being 100% completed.'); # Cleanup. -unlink 'pending.data'; -ok (!-r 'pending.data', 'Removed pending.data'); - -unlink 'completed.data'; -ok (!-r 'completed.data', 'Removed completed.data'); - -unlink 'undo.data'; -ok (!-r 'undo.data', 'Removed undo.data'); - -unlink 'bug.rc'; -ok (!-r 'bug.rc', 'Removed bug.rc'); +unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); +ok (! -r 'pending.data' && + ! -r 'completed.data' && + ! -r 'undo.data' && + ! -r 'backlog.data' && + ! -r 'synch.key' && + ! -r 'bug.rc', 'Cleanup'); exit 0;