diff --git a/ChangeLog b/ChangeLog index 6b53c6eb3..52745c9e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -240,6 +240,8 @@ to Paul-Gheorghe Barbu). + Fixed bug #901, which was preventing multiple IDs and UUIDs from being used as a filter (thanks to Bryce Harrington). + + Fixed bug #906, which caused problems with inverted project matching (thanks + to Uli Martens). + Fixed bug #910, which caused unexpected behavior when duplicating a recurring task (thanks to Jennifer Cormier). + Fixed bug #917, which mis-encoded quotes (thanks to Uli Martens). diff --git a/src/A3.cpp b/src/A3.cpp index 891e97c7d..5c3bb0010 100644 --- a/src/A3.cpp +++ b/src/A3.cpp @@ -1341,8 +1341,8 @@ bool A3::is_attmod (Nibbler& n, Arg& arg) // TODO Need more things recognized before it falls through to getUntilEOS. // n.getDate (context.config.get ("dateformat"), date) || // need Duration too. - n.getName (value) || n.getUntilWS (value) || + n.getName (value) || n.getUntilEOS (value) || // Redundant? n.depleted ()) { @@ -1355,7 +1355,7 @@ bool A3::is_attmod (Nibbler& n, Arg& arg) */ arg._raw = name + '.' + modifier + ':' + value; - Column* col = context.columns[name]; + Column* col = context.columns[name]; arg._type = col ? Arg::type_id (col->type ()) : Arg::type_pseudo; arg._category = Arg::cat_attmod; return true; diff --git a/test/bug.906.t b/test/bug.906.t new file mode 100755 index 000000000..7e6d1d031 --- /dev/null +++ b/test/bug.906.t @@ -0,0 +1,81 @@ +#! /usr/bin/perl +################################################################################ +## taskwarrior - a command line task list manager. +## +## Copyright 2006-2012, Paul Beckingham, Federico Hernandez. +## +## Permission is hereby granted, free of charge, to any person obtaining a copy +## of this software and associated documentation files (the "Software"), to deal +## in the Software without restriction, including without limitation the rights +## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +## copies of the Software, and to permit persons to whom the Software is +## furnished to do so, subject to the following conditions: +## +## The above copyright notice and this permission notice shall be included +## in all copies or substantial portions of the Software. +## +## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +## SOFTWARE. +## +## http://www.opensource.org/licenses/mit-license.php +## +################################################################################ + +use strict; +use warnings; +use Test::More tests => 17; + +# Create the rc file. +if (open my $fh, '>', 'bug.rc') +{ + print $fh "data.location=.\n", + "confirmation=off\n"; + close $fh; + ok (-r 'bug.rc', 'Created bug.rc'); +} + +# Bug 906: escaping runs amok +qx{../src/task rc:bug.rc add zero}; +qx{../src/task rc:bug.rc add one pro:a.b}; +qx{../src/task rc:bug.rc add two pro:a}; +my $output = qx{../src/task rc:bug.rc list}; +like ($output, qr/zero/, 'list - zero included'); +like ($output, qr/one/, 'list - one included'); +like ($output, qr/two/, 'list - two included'); + +$output = qx{../src/task rc:bug.rc list pro:a}; +unlike ($output, qr/zero/, 'list - zero excluded'); +like ($output, qr/one/, 'list - one included'); +like ($output, qr/two/, 'list - two included'); + +$output = qx{../src/task rc:bug.rc list pro:a.b}; +unlike ($output, qr/zero/, 'list - zero included'); +like ($output, qr/one/, 'list - one excluded'); +unlike ($output, qr/two/, 'list - two included'); + +$output = qx{../src/task rc:bug.rc list pro.not:a}; +like ($output, qr/zero/, 'list - zero included'); +unlike ($output, qr/one/, 'list - one excluded'); +unlike ($output, qr/two/, 'list - two excluded'); + +$output = qx{../src/task rc:bug.rc list pro.not:a.b}; +like ($output, qr/zero/, 'list - zero included'); +unlike ($output, qr/one/, 'list - one excluded'); +like ($output, qr/two/, 'list - two included'); + +# 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; +