- Fixed bug that caused multiple recurring child tasks to be generated
  under certain circumstances.
- Removed text.t.cpp tests that are not in task.
- Added Bryce Harrington to AUTHORS file.
- Corrected tests that were broken by the fix.
This commit is contained in:
Paul Beckingham 2011-02-12 01:00:33 -05:00
parent 776a56fa67
commit b2828b9702
7 changed files with 31 additions and 36 deletions

View file

@ -78,4 +78,5 @@ suggestions:
Andy Kriger Andy Kriger
Patrick R McDonald Patrick R McDonald
Pete Lewis Pete Lewis
Bryce Harrington

View file

@ -104,6 +104,8 @@
contained certain tokens (like 'Due:'). contained certain tokens (like 'Due:').
+ Fixed bug #654, which broke the info command when a task had no journal + Fixed bug #654, which broke the info command when a task had no journal
entries. entries.
+ Fixed bug #656, which caused multiple recurring child tasks to be created
(thanks to Bryce Harrington).
+ Fixed bug #671, removing the claim in the 'edit' command claims that + Fixed bug #671, removing the claim in the 'edit' command claims that
description text can wrap over multiple lines, because it cannot. description text can wrap over multiple lines, because it cannot.

View file

@ -311,8 +311,7 @@ int TDB::loadPending (std::vector <Task>& tasks, Filter& filter)
Task task (line); Task task (line);
Task::status status = task.getStatus (); Task::status status = task.getStatus ();
if (status != Task::recurring) task.id = mId++;
task.id = mId++;
mPending.push_back (task); mPending.push_back (task);

View file

@ -43,30 +43,30 @@ if (open my $fh, '>', 'annual.rc')
# #
# ID Project Pri Due Active Age Description # ID Project Pri Due Active Age Description
# -- ------- --- ---------- ------ --- ----------- # -- ------- --- ---------- ------ --- -----------
# 1 1/1/2000 - foo # 2 1/1/2000 - foo
# 2 12/31/2000 - foo # 3 12/31/2000 - foo
# 3 12/31/2001 - foo # 4 12/31/2001 - foo
# 4 12/31/2002 - foo # 5 12/31/2002 - foo
# 5 12/31/2003 - foo # 6 12/31/2003 - foo
# 6 12/30/2004 - foo # 7 12/30/2004 - foo
# 7 12/30/2005 - foo # 8 12/30/2005 - foo
# 8 12/30/2006 - foo # 9 12/30/2006 - foo
# 9 12/30/2007 - foo # 10 12/30/2007 - foo
# 10 12/29/2008 - foo # 11 13/29/2008 - foo
# 11 12/29/2009 - foo # 12 12/29/2009 - foo
qx{../src/task rc:annual.rc add foo due:1/1/2000 recur:annual until:1/1/2009}; qx{../src/task rc:annual.rc add foo due:1/1/2000 recur:annual until:1/1/2009};
my $output = qx{../src/task rc:annual.rc list}; my $output = qx{../src/task rc:annual.rc list};
like ($output, qr/1\s+1\/1\/2000\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 1 no creep'); like ($output, qr/2\s+1\/1\/2000\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 2 no creep');
like ($output, qr/2\s+1\/1\/2001\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 2 no creep'); like ($output, qr/3\s+1\/1\/2001\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 3 no creep');
like ($output, qr/3\s+1\/1\/2002\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 3 no creep'); like ($output, qr/4\s+1\/1\/2002\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 4 no creep');
like ($output, qr/4\s+1\/1\/2003\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 4 no creep'); like ($output, qr/5\s+1\/1\/2003\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 5 no creep');
like ($output, qr/5\s+1\/1\/2004\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 5 no creep'); like ($output, qr/6\s+1\/1\/2004\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 6 no creep');
like ($output, qr/6\s+1\/1\/2005\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 6 no creep'); like ($output, qr/7\s+1\/1\/2005\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 7 no creep');
like ($output, qr/7\s+1\/1\/2006\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 7 no creep'); like ($output, qr/8\s+1\/1\/2006\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 8 no creep');
like ($output, qr/8\s+1\/1\/2007\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 8 no creep'); like ($output, qr/9\s+1\/1\/2007\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 9 no creep');
like ($output, qr/9\s+1\/1\/2008\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 9 no creep'); like ($output, qr/10\s+1\/1\/2008\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 10 no creep');
like ($output, qr/10\s+1\/1\/2009\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 10 no creep'); like ($output, qr/11\s+1\/1\/2009\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 11 no creep');
# Cleanup. # Cleanup.
unlink 'pending.data'; unlink 'pending.data';

View file

@ -47,12 +47,12 @@ qx{../src/task rc:custom.rc add foo due:tomorrow recur:weekly};
qx{../src/task rc:custom.rc add bar}; qx{../src/task rc:custom.rc add bar};
my $output = qx{../src/task rc:custom.rc foo 2>&1}; my $output = qx{../src/task rc:custom.rc foo 2>&1};
like ($output, qr/ID R/, 'Recurrence indicator heading'); like ($output, qr/ID R/, 'Recurrence indicator heading');
like ($output, qr/2\s+R/, 'Recurrence indicator t1'); like ($output, qr/3\s+R/, 'Recurrence indicator t1');
unlike ($output, qr/1\s+R/, 'No recurrence indicator t2'); unlike ($output, qr/2\s+R/, 'No recurrence indicator t2');
$output = qx{../src/task rc:custom.rc foo rc.recurrence.indicator=RE 2>&1}; $output = qx{../src/task rc:custom.rc foo rc.recurrence.indicator=RE 2>&1};
like ($output, qr/2\s+RE/, 'Custom recurrence indicator t1'); like ($output, qr/3\s+RE/, 'Custom recurrence indicator t1');
unlike ($output, qr/1\s+RE/, 'No custom recurrence indicator t2'); unlike ($output, qr/2\s+RE/, 'No custom recurrence indicator t2');
# Cleanup. # Cleanup.
unlink 'pending.data'; unlink 'pending.data';

View file

@ -43,10 +43,10 @@ qx{../src/task rc:recur.rc add foo due:now recur:2sec until:5sec};
diag ("Sleeping for 6 seconds"); diag ("Sleeping for 6 seconds");
sleep 6; sleep 6;
my $output = qx{../src/task rc:recur.rc list}; my $output = qx{../src/task rc:recur.rc list};
like ($output, qr/^\s+1/ms, 'Found 1');
like ($output, qr/^\s+2/ms, 'Found 2'); like ($output, qr/^\s+2/ms, 'Found 2');
like ($output, qr/^\s+3/ms, 'Found 3'); like ($output, qr/^\s+3/ms, 'Found 3');
like ($output, qr/^\s+4/ms, 'Found 4'); like ($output, qr/^\s+4/ms, 'Found 4');
like ($output, qr/^\s+5/ms, 'Found 5');
qx{../src/task rc:recur.rc do $_} for 1..5; qx{../src/task rc:recur.rc do $_} for 1..5;
$output = qx{../src/task rc:recur.rc list}; $output = qx{../src/task rc:recur.rc list};

View file

@ -34,7 +34,7 @@ Context context;
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
int main (int argc, char** argv) int main (int argc, char** argv)
{ {
UnitTest t (213); UnitTest t (208);
// void wrapText (std::vector <std::string>& lines, const std::string& text, const int width) // void wrapText (std::vector <std::string>& lines, const std::string& text, const int width)
std::string text = "This is a test of the line wrapping code."; std::string text = "This is a test of the line wrapping code.";
@ -416,13 +416,6 @@ int main (int argc, char** argv)
// std::string format (double, int, int); // std::string format (double, int, int);
// std::string printable (const std::string&);
t.is (printable ("a\rb"), "a\\rb", "printable <carriage-return> -> \\r");
t.is (printable ("a\nb"), "a\\nb", "printable <newline> -> \\n");
t.is (printable ("a\fb"), "a\\fb", "printable <formfeed> -> \\f");
t.is (printable ("a\tb"), "a\\tb", "printable <tab> -> \\t");
t.is (printable ("a\vb"), "a\\vb", "printable <vertical-space> -> \\v");
return 0; return 0;
} }