From c8aca24e635fcc0b99ff87e9a2de7c71088dd98d Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 19 Oct 2013 16:44:33 -0400 Subject: [PATCH] Reports - New 'list' report. --- src/Config.cpp | 9 +++++---- test/bug.495.t | 2 +- test/bug.703.t | 4 ++-- test/bug.879.t | 6 +++--- test/bug.924.t | 6 +++--- test/bug.932.t | 6 +++--- test/bug.annual.t | 20 ++++++++++---------- test/default.t | 2 +- test/start.t | 10 +++++----- test/subproject.t | 14 +++++++------- 10 files changed, 40 insertions(+), 39 deletions(-) diff --git a/src/Config.cpp b/src/Config.cpp index c6e89487c..8cf4bf277 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -317,11 +317,12 @@ std::string Config::_defaults = "report.long.filter= ( status:pending or status:waiting )\n" "report.long.sort=modified-\n" "\n" - "report.list.description=Lists all pending tasks\n" - "report.list.columns=id,project,priority,due,start.active,entry.age,description\n" - "report.list.labels=ID,Proj,Pri,Due,Active,Age,Description\n" - "report.list.sort=due+,priority-,start-,project+\n" + "report.list.description=Actionable tasks by due date, project and urgency\n" + "report.list.labels=ID,Active,Age,D,P,Project,Tags,R,Sch,Due,Until,Description,Urg\n" + "report.list.columns=id,start.age,entry.age,depends.indicator,priority,project,tags,recur.indicator,scheduled.countdown,due,until.age,description.count,urgency\n" "report.list.filter=status:pending\n" + "report.list.sort=start-,due+,project+,urgency-,description+,entry+\n" + "\n" "\n" "report.ls.description=Minimal listing of all pending tasks\n" "report.ls.columns=id,project,priority,description\n" diff --git a/test/bug.495.t b/test/bug.495.t index 77f3288c4..036aefb76 100755 --- a/test/bug.495.t +++ b/test/bug.495.t @@ -43,7 +43,7 @@ if (open my $fh, '>', 'bug.rc') # Bug #495 - double hyphen mishandled for annotations. qx{../src/task rc:bug.rc add foo 2>&1}; qx{../src/task rc:bug.rc 1 annotate "This -- is -- a -- test" 2>&1}; -my $output = qx{../src/task rc:bug.rc list 2>&1}; +my $output = qx{../src/task rc:bug.rc long 2>&1}; like ($output, qr/This is -- a -- test/, 'Double hyphens preserved, except the first ones.'); # Cleanup. diff --git a/test/bug.703.t b/test/bug.703.t index 5438c49b5..852bfcaa0 100755 --- a/test/bug.703.t +++ b/test/bug.703.t @@ -47,14 +47,14 @@ qx{../src/task rc:bug.rc 1 annotate Annotation one 2>&1}; qx{../src/task rc:bug.rc 1 annotate Annotation two 2>&1}; qx{../src/task rc:bug.rc 1 annotate Annotation three 2>&1}; -my $output = qx{../src/task rc:bug.rc list 2>&1}; +my $output = qx{../src/task rc:bug.rc long 2>&1}; like ($output, qr/This is a test/, 'original description'); like ($output, qr/Annotation one/, 'original annotation one'); like ($output, qr/Annotation two/, 'original annotation two'); like ($output, qr/Annotation three/, 'original annotation three'); qx{../src/task rc:bug.rc 1 modify /i/I/g 2>&1}; -$output = qx{../src/task rc:bug.rc list 2>&1}; +$output = qx{../src/task rc:bug.rc long 2>&1}; like ($output, qr/ThIs Is a test/, 'new description'); like ($output, qr/AnnotatIon one/, 'new annotation one'); like ($output, qr/AnnotatIon two/, 'new annotation two'); diff --git a/test/bug.879.t b/test/bug.879.t index 6c4efcd6a..abf6477f9 100755 --- a/test/bug.879.t +++ b/test/bug.879.t @@ -40,16 +40,16 @@ if (open my $fh, '>', 'bug.rc') # Bug 879: Backslash at end of description/annotation causes problems. qx{../src/task rc:bug.rc add one\\\\ 2>&1}; -my $output = qx{../src/task rc:bug.rc list 2>&1}; +my $output = qx{../src/task rc:bug.rc long 2>&1}; like ($output, qr/one\\/, 'Backslash preserved in description'); qx{../src/task rc:bug.rc 1 annotate foo\\\\ 2>&1}; -$output = qx{../src/task rc:bug.rc list 2>&1}; +$output = qx{../src/task rc:bug.rc long 2>&1}; like ($output, qr/one\\/, 'Backslash preserved in description'); like ($output, qr/foo\\/, 'Backslash preserved in annotation 1'); qx{../src/task rc:bug.rc 1 annotate bar\\\\ 2>&1}; -$output = qx{../src/task rc:bug.rc list 2>&1}; +$output = qx{../src/task rc:bug.rc long 2>&1}; like ($output, qr/one\\/, 'Backslash preserved in description'); like ($output, qr/foo\\/, 'Backslash preserved in annotation 1'); like ($output, qr/bar\\/, 'Backslash preserved in annotation 2'); diff --git a/test/bug.924.t b/test/bug.924.t index d94ae3d47..b1849cbaf 100755 --- a/test/bug.924.t +++ b/test/bug.924.t @@ -43,9 +43,9 @@ qx{../src/task rc:bug.rc add release 1.0 2>&1}; qx{../src/task rc:bug.rc add 'release 2.0' 2>&1}; qx{../src/task rc:bug.rc add "release 3.0" 2>&1}; my $output = qx{../src/task rc:bug.rc list 2>&1}; -like ($output, qr/\s1.0\n/ms, 'Plain text floating point preserved'); -like ($output, qr/\s2.0\n/ms, 'Single quote floating point preserved'); -like ($output, qr/\s3.0\n/ms, 'Double quote floating point preserved'); +like ($output, qr/\s1.0\s/ms, 'Plain text floating point preserved'); +like ($output, qr/\s2.0\s/ms, 'Single quote floating point preserved'); +like ($output, qr/\s3.0\s/ms, 'Double quote floating point preserved'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data bug.rc); diff --git a/test/bug.932.t b/test/bug.932.t index 9e15613f2..b68ba593d 100755 --- a/test/bug.932.t +++ b/test/bug.932.t @@ -57,9 +57,9 @@ like ($output, qr/4\s+P.+R/ms, 'Found modified child 2 (propagated from 0)'); qx{echo 'y' | ../src/task rc:bug.rc 1 mod priority:H 2>&1}; $output = qx{../src/task rc:bug.rc list 2>&1}; -like ($output, qr/2\s+P.+H.+R/ms, 'Found modified child 0 (propagated from parent'); -like ($output, qr/3\s+P.+H.+R/ms, 'Found modified child 1 (propagated from parent)'); -like ($output, qr/4\s+P.+H.+R/ms, 'Found modified child 2 (propagated from parent)'); +like ($output, qr/2\s+H.+P.+R/ms, 'Found modified child 0 (propagated from parent'); +like ($output, qr/3\s+H.+P.+R/ms, 'Found modified child 1 (propagated from parent)'); +like ($output, qr/4\s+H.+P.+R/ms, 'Found modified child 2 (propagated from parent)'); $output = qx{../src/task rc:bug.rc diag 2>&1}; like ($output, qr/No duplicates found/, 'No duplicate UUIDs detected'); diff --git a/test/bug.annual.t b/test/bug.annual.t index adb21704d..feb23f007 100755 --- a/test/bug.annual.t +++ b/test/bug.annual.t @@ -58,16 +58,16 @@ if (open my $fh, '>', 'annual.rc') qx{../src/task rc:annual.rc add foo due:1/1/2000 recur:annual until:1/1/2009 2>&1}; my $output = qx{../src/task rc:annual.rc list 2>&1}; -like ($output, qr/2\s+1\/1\/2000\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/4\s+1\/1\/2002\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/6\s+1\/1\/2004\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/8\s+1\/1\/2006\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/10\s+1\/1\/2008\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'); +like ($output, qr/2\s+R\s+1\/1\/2000\s+.+foo/, 'synthetic 2 no creep'); +like ($output, qr/3\s+R\s+1\/1\/2001\s+.+foo/, 'synthetic 3 no creep'); +like ($output, qr/4\s+R\s+1\/1\/2002\s+.+foo/, 'synthetic 4 no creep'); +like ($output, qr/5\s+R\s+1\/1\/2003\s+.+foo/, 'synthetic 5 no creep'); +like ($output, qr/6\s+R\s+1\/1\/2004\s+.+foo/, 'synthetic 6 no creep'); +like ($output, qr/7\s+R\s+1\/1\/2005\s+.+foo/, 'synthetic 7 no creep'); +like ($output, qr/8\s+R\s+1\/1\/2006\s+.+foo/, 'synthetic 8 no creep'); +like ($output, qr/9\s+R\s+1\/1\/2007\s+.+foo/, 'synthetic 9 no creep'); +like ($output, qr/10\s+R\s+1\/1\/2008\s+.+foo/, 'synthetic 10 no creep'); +like ($output, qr/11\s+R\s+1\/1\/2009\s+.+foo/, 'synthetic 11 no creep'); $output = qx{../src/task rc:annual.rc diag 2>&1}; like ($output, qr/No duplicates found/, 'No duplicate UUIDs detected'); diff --git a/test/default.t b/test/default.t index ddef46dff..2b1781b37 100755 --- a/test/default.t +++ b/test/default.t @@ -76,7 +76,7 @@ like ($output, qr/ L /, 'priority specified'); like ($output, qr/\//, 'default due added'); $output = qx{../src/task rc:default.rc 2>&1}; -like ($output, qr/1 PROJECT L .+ priority specified/, 'default command worked'); +like ($output, qr/1 .+ L PROJECT .+ priority specified/, 'default command worked'); qx{../src/task rc:default.rc add project:HOME priority:M due:tomorrow all specified 2>&1}; qx{echo 'y' | ../src/task rc:default.rc config default.command 'list priority:M' 2>&1}; diff --git a/test/start.t b/test/start.t index f541387b0..737e54578 100755 --- a/test/start.t +++ b/test/start.t @@ -62,7 +62,7 @@ unlike ($output, qr/one/, 'one not active'); unlike ($output, qr/two/, 'two not active'); qx{../src/task rc:start.rc 2 done 2>&1}; -$output = qx{../src/task rc:start.rc list 2>&1}; +$output = qx{../src/task rc:start.rc long 2>&1}; unlike ($output, qr/two/, 'two deleted'); # Create the rc file. @@ -75,11 +75,11 @@ if (open my $fh, '>', 'start2.rc') } qx{../src/task rc:start2.rc 1 start 2>&1}; -$output = qx{../src/task rc:start2.rc list 2>&1}; +$output = qx{../src/task rc:start2.rc long 2>&1}; like ($output, qr/Started task/, 'one start and annotated'); qx{../src/task rc:start2.rc 1 stop 2>&1}; -$output = qx{../src/task rc:start2.rc list 2>&1}; +$output = qx{../src/task rc:start2.rc long 2>&1}; like ($output, qr/Stopped task/, 'one stopped and annotated'); # Create the rc file. @@ -94,11 +94,11 @@ if (open my $fh, '>', 'start3.rc') } qx{../src/task rc:start3.rc 1 start 2>&1}; -$output = qx{../src/task rc:start3.rc list 2>&1}; +$output = qx{../src/task rc:start3.rc long 2>&1}; like ($output, qr/Nu.+kör.+vi/ms, 'one start and annotated with custom description'); qx{../src/task rc:start3.rc 1 stop 2>&1}; -$output = qx{../src/task rc:start3.rc list 2>&1}; +$output = qx{../src/task rc:start3.rc long 2>&1}; like ($output, qr/Nu.+stannar.+vi/ms, 'one stopped and annotated with custom description'); # Cleanup. diff --git a/test/subproject.t b/test/subproject.t index 2ecfc02b4..9e3881fe5 100755 --- a/test/subproject.t +++ b/test/subproject.t @@ -45,19 +45,19 @@ my $setup = "../src/task rc:sp.rc add project:abc abc 2>&1;" qx{$setup}; my $output = qx{../src/task rc:sp.rc list project:b 2>&1}; -like ($output, qr/\bb\s*$/m, 'abc,ab,a,b | b -> b'); +like ($output, qr/\bb\s/m, 'abc,ab,a,b | b -> b'); $output = qx{../src/task rc:sp.rc list project:a 2>&1}; -like ($output, qr/\babc\s*$/m, 'abc,ab,a,b | a -> abc'); -like ($output, qr/\bab\s*$/m, 'abc,ab,a,b | a -> ab'); -like ($output, qr/\ba\s*$/m, 'abc,ab,a,b | a -> a'); +like ($output, qr/\babc\s/m, 'abc,ab,a,b | a -> abc'); +like ($output, qr/\bab\s/m, 'abc,ab,a,b | a -> ab'); +like ($output, qr/\ba\s/m, 'abc,ab,a,b | a -> a'); $output = qx{../src/task rc:sp.rc list project:ab 2>&1}; -like ($output, qr/\babc\s*$/m, 'abc,ab,a,b | a -> abc'); -like ($output, qr/\bab\s*$/m, 'abc,ab,a,b | a -> ab'); +like ($output, qr/\babc\s/m, 'abc,ab,a,b | a -> abc'); +like ($output, qr/\bab\s/m, 'abc,ab,a,b | a -> ab'); $output = qx{../src/task rc:sp.rc list project:abc 2>&1}; -like ($output, qr/\babc\s*$/m, 'abc,ab,a,b | a -> abc'); +like ($output, qr/\babc\s/m, 'abc,ab,a,b | a -> abc'); $output = qx{../src/task rc:sp.rc list project:abcd 2>&1 >/dev/null}; like ($output, qr/No matches./, 'abc,ab,a,b | abcd -> nul');