mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-20 04:13:07 +02:00
Bug #856
- Fixed bug #856, which prevented filters on missing project from working (thanks to Michelle Crane).
This commit is contained in:
parent
373af5ba65
commit
a99aa217d0
3 changed files with 91 additions and 7 deletions
|
@ -195,6 +195,8 @@
|
||||||
Gour D).
|
Gour D).
|
||||||
+ Fixed bug #846, which prevented the default.command configuration from
|
+ Fixed bug #846, which prevented the default.command configuration from
|
||||||
handling multiple arguments (thanks to Uli Martens).
|
handling multiple arguments (thanks to Uli Martens).
|
||||||
|
+ Fixed bug #856, which prevented filters on missing project from working
|
||||||
|
(thanks to Michelle Crane).
|
||||||
|
|
||||||
# Untracked Bugs, biggest first.
|
# Untracked Bugs, biggest first.
|
||||||
+ Fixed bug that required the '%YAML' prologue in a YAML import.
|
+ Fixed bug that required the '%YAML' prologue in a YAML import.
|
||||||
|
|
13
src/E9.cpp
13
src/E9.cpp
|
@ -471,6 +471,18 @@ void E9::operator_equal (
|
||||||
|
|
||||||
// 'project' is matched leftmost.
|
// 'project' is matched leftmost.
|
||||||
if (left._raw == "project")
|
if (left._raw == "project")
|
||||||
|
{
|
||||||
|
// Bug 856.
|
||||||
|
//
|
||||||
|
// Special case for checking absent projects. Without the explicit "" check
|
||||||
|
// the right._value.lenghth() is used, which is 0, and therefore generates
|
||||||
|
// a false match.
|
||||||
|
if (right._value == "")
|
||||||
|
{
|
||||||
|
if (left._value == "")
|
||||||
|
result._value = "true";
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
unsigned int right_len = right._value.length ();
|
unsigned int right_len = right._value.length ();
|
||||||
if (compare (right._value,
|
if (compare (right._value,
|
||||||
|
@ -482,6 +494,7 @@ void E9::operator_equal (
|
||||||
result._value = "true";
|
result._value = "true";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Dates. Note that missing data causes processing to transfer to the generic
|
// Dates. Note that missing data causes processing to transfer to the generic
|
||||||
// string comparison below.
|
// string comparison below.
|
||||||
|
|
69
test/bug.856.t
Executable file
69
test/bug.856.t
Executable file
|
@ -0,0 +1,69 @@
|
||||||
|
#! /usr/bin/perl
|
||||||
|
################################################################################
|
||||||
|
## taskwarrior - a command line task list manager.
|
||||||
|
##
|
||||||
|
## Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez.
|
||||||
|
## All rights reserved.
|
||||||
|
##
|
||||||
|
## This program is free software; you can redistribute it and/or modify it under
|
||||||
|
## the terms of the GNU General Public License as published by the Free Software
|
||||||
|
## Foundation; either version 2 of the License, or (at your option) any later
|
||||||
|
## version.
|
||||||
|
##
|
||||||
|
## This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||||
|
## details.
|
||||||
|
##
|
||||||
|
## You should have received a copy of the GNU General Public License along with
|
||||||
|
## this program; if not, write to the
|
||||||
|
##
|
||||||
|
## Free Software Foundation, Inc.,
|
||||||
|
## 51 Franklin Street, Fifth Floor,
|
||||||
|
## Boston, MA
|
||||||
|
## 02110-1301
|
||||||
|
## USA
|
||||||
|
##
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use Test::More tests => 8;
|
||||||
|
|
||||||
|
# Create the rc file.
|
||||||
|
if (open my $fh, '>', 'bug.rc')
|
||||||
|
{
|
||||||
|
print $fh "data.location=.\n";
|
||||||
|
close $fh;
|
||||||
|
ok (-r 'bug.rc', 'Created bug.rc');
|
||||||
|
}
|
||||||
|
|
||||||
|
# Bug 856: "task list project.none:" does not work.
|
||||||
|
# Note: Not using "assigned" and "unassigned" because one is a subset of the
|
||||||
|
# other.
|
||||||
|
qx{../src/task rc:bug.rc add assigned project:X};
|
||||||
|
qx{../src/task rc:bug.rc add floating};
|
||||||
|
|
||||||
|
my $output = qx{../src/task rc:bug.rc ls project:};
|
||||||
|
like ($output, qr/floating/, 'project: matches floating');
|
||||||
|
unlike ($output, qr/assigned/, 'project: does not match assigned');
|
||||||
|
|
||||||
|
$output = qx{../src/task rc:bug.rc ls project:''};
|
||||||
|
like ($output, qr/floating/, 'project:\'\' matches floating');
|
||||||
|
unlike ($output, qr/assigned/, 'project:\'\' does not match assigned');
|
||||||
|
|
||||||
|
$output = qx{../src/task rc:bug.rc ls project.none:};
|
||||||
|
like ($output, qr/floating/, 'project.none: matches floating');
|
||||||
|
unlike ($output, qr/assigned/, 'project.none: does not match assigned');
|
||||||
|
|
||||||
|
# Cleanup.
|
||||||
|
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;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue