mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-02 14:38:34 +02:00
Patch - Support tag exclusion filtering
- Now supports "-tag" in filters to filter out tasks that do not have the specified tag (thanks to Chris Pride). - Added unit tests to prevent regression. - Updated the filter docs to include examples.
This commit is contained in:
parent
0fcaf85652
commit
7aace1b3db
5 changed files with 55 additions and 4 deletions
|
@ -28,7 +28,7 @@
|
|||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 108;
|
||||
use Test::More tests => 129;
|
||||
|
||||
# Create the rc file.
|
||||
if (open my $fh, '>', 'filter.rc')
|
||||
|
@ -110,6 +110,33 @@ like ($output, qr/five/, 'g5');
|
|||
unlike ($output, qr/six/, 'g6');
|
||||
unlike ($output, qr/seven/, 'g7');
|
||||
|
||||
$output = qx{../task rc:filter.rc list -tag};
|
||||
unlike ($output, qr/one/, 'g1');
|
||||
like ($output, qr/two/, 'g2');
|
||||
like ($output, qr/three/, 'g3');
|
||||
like ($output, qr/four/, 'g4');
|
||||
unlike ($output, qr/five/, 'g5');
|
||||
like ($output, qr/six/, 'g6');
|
||||
like ($output, qr/seven/, 'g7');
|
||||
|
||||
$output = qx{../task rc:filter.rc list -missing};
|
||||
like ($output, qr/one/, 'g1');
|
||||
like ($output, qr/two/, 'g2');
|
||||
like ($output, qr/three/, 'g3');
|
||||
like ($output, qr/four/, 'g4');
|
||||
like ($output, qr/five/, 'g5');
|
||||
like ($output, qr/six/, 'g6');
|
||||
like ($output, qr/seven/, 'g7');
|
||||
|
||||
$output = qx{../task rc:filter.rc list +tag -tag};
|
||||
unlike ($output, qr/one/, 'g1');
|
||||
unlike ($output, qr/two/, 'g2');
|
||||
unlike ($output, qr/three/, 'g3');
|
||||
unlike ($output, qr/four/, 'g4');
|
||||
unlike ($output, qr/five/, 'g5');
|
||||
unlike ($output, qr/six/, 'g6');
|
||||
unlike ($output, qr/seven/, 'g7');
|
||||
|
||||
$output = qx{../task rc:filter.rc list project:A priority:H};
|
||||
like ($output, qr/one/, 'h1');
|
||||
like ($output, qr/two/, 'h2');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue