From 45262be01103dcfecdbde7d1e9db7dd9b6412bb0 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 16 Oct 2011 00:44:24 -0400 Subject: [PATCH] Bug #860 - Fixed bug #860, which prevented lower-case priority values from being accepted (thanks to Michelle Crane). - Added unit tests. - Also included ChangeLog updates from other fixes that were misseed. --- ChangeLog | 9 +++++++ src/commands/Command.cpp | 6 +++++ test/bug.860.t | 56 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+) create mode 100755 test/bug.860.t diff --git a/ChangeLog b/ChangeLog index b1ce89c0d..dcd09601d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -47,6 +47,7 @@ + Added feature #422, #566 and #639, which allow task modifications during 'done', 'delete', 'start', 'stop' and 'duplicate' commands (thanks to Max Muller). + + Added feature #474, which means the 'info' command accepts filters. + Added feature #479, which enables filtering for the 'calendar' command. + Added feature #496, which allows rc.default.command to be supplemented with a filter, so that 'task project:Home' applies the project filter to the @@ -102,6 +103,8 @@ Aikido Guy). # Tracked Bugs, sorted by ID. + + Fixed bug #208, which addresses various problems with recurring tasks, and + change propagation. + Fixed bug #403, which disambiguates certain commands involving numbers. + Fixed bug #458, removing the ambiguous 'm' as a duration, leaving 'mi[nutes]' and 'mo[nths]' requiring at least two characters for a match. @@ -139,6 +142,8 @@ Alexei Romanoff). + Fixed bug #720, so that when the 'info' report renders total active time, it uses a lossless format (thanks to Bernhard B). + + Fixed bug #722, #801, so that all recurring task change propagations are + confirmed (thanks to Arkady Grudzinsky). + Fixed bug #723, which displayed a misleading message when the output was truncated to a page. + Fixed bug #732, which fixes misleading messages and documentation for @@ -190,6 +195,8 @@ Owen Clarke). + Fixed bug #822, #845, which generated incorrect IDs (thanks to Matt Kraai and Michelle Crane). + + Fixed bug #823, so that recurring task change propagations are now always + confirmed (thanks to Miguel de Val Borro). + Fixed bug #824, which caused probles when completing recurring tasks (thanks to Matt Kraai). + Fixed bug #831, which prevented some date fields from being properly parsed. @@ -205,6 +212,8 @@ (thanks to Michelle Crane). + Fixed bug #859, which used only one color for the 'ghistory.*' report legends (thanks to Uli Martens). + + Fixed bug #860, which prevented lower-case priority values from being + accepted (thanks to Michelle Crane). + Fixed bug #862, which suppressed feedback from the 'denotate' command. # Untracked Bugs, biggest first. diff --git a/src/commands/Command.cpp b/src/commands/Command.cpp index 365d2ac99..8140f0021 100644 --- a/src/commands/Command.cpp +++ b/src/commands/Command.cpp @@ -466,6 +466,12 @@ void Command::modify_task ( } } + // Priorities are converted to upper case. + else if (name == "priority") + { + task.set (name, upperCase (value)); + } + // Dates are special, maybe. else if (column->type () == "date") { diff --git a/test/bug.860.t b/test/bug.860.t new file mode 100755 index 000000000..60dc2e88d --- /dev/null +++ b/test/bug.860.t @@ -0,0 +1,56 @@ +#! /usr/bin/perl +################################################################################ +## taskwarrior - a command line task list manager. +## +## Copyright 2006-2011, 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 869: lower case priorities aren't accepted. +qx{../src/task rc:bug.rc add foo pri:h}; +my $output = qx{../src/task rc:bug.rc 1 info}; +like ($output, qr/Priority\s+H/, "pri:h --> pri:H"); + +# 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; +