diff --git a/ChangeLog b/ChangeLog index 6b21fec72..c607c9964 100644 --- a/ChangeLog +++ b/ChangeLog @@ -36,8 +36,8 @@ Features + Added new export script: export-tsv.pl. Bugs - + Fixed bug #947, #1031, which kept expanding aliases after the '--' operator - (thanks to Jim B). + + Fixed bug #1110, which did not treat 'status:Completed' the same + as 'status:completed' (thanks to Aikido Guy). + Fixed bug #1038, which prints blank lines with bulk changes and when the verbose attributes does not specify it. Lines do a better separation between each changes also. diff --git a/src/E9.cpp b/src/E9.cpp index 97a8c3e17..51cc32554 100644 --- a/src/E9.cpp +++ b/src/E9.cpp @@ -533,6 +533,14 @@ void E9::operator_equal ( : "false"; } + // Case-insensitive comparison for status. Fixes #1110. + else if (left._raw == "status") + { + result._value = compare (left._value, right._value, false) + ? "true" + : "false"; + } + // Regular equality matching. else { diff --git a/test/bug.1110.t b/test/bug.1110.t new file mode 100755 index 000000000..eb217eb91 --- /dev/null +++ b/test/bug.1110.t @@ -0,0 +1,57 @@ +#! /usr/bin/env 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 => 3; + +# 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 1110: reports print "Completed" but "Completed" != "completed" +qx{../src/task rc:bug.rc add ToBeCompleted 2>&1}; +qx{../src/task rc:bug.rc 1 done 2>&1}; + +my $output = qx{../src/task all status:Completed rc:bug.rc 2>&1}; +like ($output, qr/ToBeCompleted/, 'status:Completed returns completed tasks'); + +# 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;