mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Reports
- New 'list' report.
This commit is contained in:
parent
325c80b7e4
commit
c8aca24e63
10 changed files with 40 additions and 39 deletions
|
@ -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.
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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};
|
||||
|
|
10
test/start.t
10
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.
|
||||
|
|
|
@ -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');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue