Merge branch '1.9.3' of tasktools.org:task into 1.9.3

Conflicts:
	src/Config.cpp
This commit is contained in:
Johannes Schlatow
2010-09-02 01:53:25 +02:00
27 changed files with 663 additions and 338 deletions

View File

@@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 13;
use Test::More tests => 40;
# Create the rc file.
if (open my $fh, '>', 'bug.rc')
@@ -59,6 +59,67 @@ $output = qx{../task rc:bug.rc long -\@strange};
like ($output, qr/one/, '+ordinary implicitly included');
unlike ($output, qr/two/, '@strange explicitly excluded');
# Bug #XXX - '-t1 -t2' doesn't seem to work, when @ characters are involved.
unlink 'pending.data';
qx{../task rc:bug.rc add one +t1};
qx{../task rc:bug.rc add two +t2};
qx{../task rc:bug.rc add three +t3};
my $output = qx{../task rc:bug.rc list -t1};
unlike ($output, qr/one/, 'Single: no t1');
like ($output, qr/two/, 'Single: yes t2');
like ($output, qr/three/, 'Single: yes t3');
$output = qx{../task rc:bug.rc list -t1 -t2};
unlike ($output, qr/one/, 'Double: no t1');
unlike ($output, qr/two/, 'Double: no t2');
like ($output, qr/three/, 'Double: yes t3');
$output = qx{../task rc:bug.rc list -t1 -t2 -t3};
unlike ($output, qr/one/, 'Triple: no t1');
unlike ($output, qr/two/, 'Triple: no t2');
unlike ($output, qr/three/, 'Triple: no t3');
# Once again, with @ characters.
qx{../task rc:bug.rc 1 +\@1};
qx{../task rc:bug.rc 2 +\@2};
qx{../task rc:bug.rc 3 +\@3};
$output = qx{../task rc:bug.rc list -\@1};
unlike ($output, qr/one/, 'Single: no @1');
like ($output, qr/two/, 'Single: yes @2');
like ($output, qr/three/, 'Single: yes @3');
$output = qx{../task rc:bug.rc list -\@1 -\@2};
unlike ($output, qr/one/, 'Double: no @1');
unlike ($output, qr/two/, 'Double: no @2');
like ($output, qr/three/, 'Double: yes @3');
$output = qx{../task rc:bug.rc list -\@1 -\@2 -\@3};
unlike ($output, qr/one/, 'Triple: no @1');
unlike ($output, qr/two/, 'Triple: no @2');
unlike ($output, qr/three/, 'Triple: no @3');
# Once again, with @ characters and punctuation.
qx{../task rc:bug.rc 1 +\@foo.1};
qx{../task rc:bug.rc 2 +\@foo.2};
qx{../task rc:bug.rc 3 +\@foo.3};
$output = qx{../task rc:bug.rc list -\@foo.1};
unlike ($output, qr/one/, 'Single: no @foo.1');
like ($output, qr/two/, 'Single: yes @foo.2');
like ($output, qr/three/, 'Single: yes @foo.3');
$output = qx{../task rc:bug.rc list -\@foo.1 -\@foo.2};
unlike ($output, qr/one/, 'Double: no @foo.1');
unlike ($output, qr/two/, 'Double: no @foo.2');
like ($output, qr/three/, 'Double: yes @foo.3');
$output = qx{../task rc:bug.rc list -\@foo.1 -\@foo.2 -\@foo.3};
unlike ($output, qr/one/, 'Triple: no @foo.1');
unlike ($output, qr/two/, 'Triple: no @foo.2');
unlike ($output, qr/three/, 'Triple: no @foo.3');
# Cleanup.
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');

66
src/tests/bug.485.x Executable file
View File

@@ -0,0 +1,66 @@
#! /usr/bin/perl
################################################################################
## taskwarrior - a command line task list manager.
##
## Copyright 2006 - 2010, Paul Beckingham.
## 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 => 9;
# 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 #485 - 'task list recur:month' doesn't list monthly tasks
qx{../task rc:bug.rc add one due:tomorrow recur:monthly};
qx{../task rc:bug.rc add two due:tomorrow recur:month};
my $output = qx{../task rc:bug.rc list recur:monthly};
like ($output, qr/one/, 'monthly -> monthly');
like ($output, qr/two/, 'month -> monthly');
$output = qx{../task rc:bug.rc list recur:month};
like ($output, qr/one/, 'monthly -> month');
like ($output, qr/two/, 'month -> month');
# Cleanup.
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'completed.data';
ok (!-r 'completed.data', 'Removed completed.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'bug.rc';
ok (!-r 'bug.rc', 'Removed bug.rc');
exit 0;

View File

@@ -2,7 +2,7 @@
################################################################################
## taskwarrior - a command line task list manager.
##
## Copyright 2006 - 2010, Paul Beckingham.
## Copyright 2006 - 2010, Paul Beckingham, Federico Hernandez.
## All rights reserved.
##
## This program is free software; you can redistribute it and/or modify it under
@@ -28,15 +28,18 @@
use strict;
use warnings;
use Test::More tests => 8;
use Test::More tests => 9;
# Create the rc file.
if (open my $fh, '>', 'color.rc')
{
print $fh "data.location=.\n",
"search.case.sensitive=yes\n",
"color=on\n",
"color.alternate=\n",
"color.keyword.red=red\n",
"color.keyword.green=green\n",
"color.keyword.yellow=yellow\n",
"_forcecolor=1\n";
close $fh;
ok (-r 'color.rc', 'Created color.rc');
@@ -46,11 +49,14 @@ if (open my $fh, '>', 'color.rc')
qx{../task rc:color.rc add nothing};
qx{../task rc:color.rc add red};
qx{../task rc:color.rc add green};
qx{../task rc:color.rc add -- annotation};
qx{../task rc:color.rc 4 annotate yellow};
my $output = qx{../task rc:color.rc list};
like ($output, qr/ (?!<\033\[\d\dm) .* nothing .* (?!>\033\[0m) /x, 'none');
like ($output, qr/ \033\[31m .* red .* \033\[0m /x, 'color.keyword.red');
like ($output, qr/ \033\[32m .* green .* \033\[0m /x, 'color.keyword.green');
like ($output, qr/ (?!<\033\[\d\dm) .* nothing .* (?!>\033\[0m) /x, 'none');
like ($output, qr/ \033\[31m .* red .* \033\[0m /x, 'color.keyword.red');
like ($output, qr/ \033\[32m .* green .* \033\[0m /x, 'color.keyword.green');
like ($output, qr/ \033\[33m .* annotation .* \033\[0m /x, 'color.keyword.yellow (annotation)');
# Cleanup.
unlink 'pending.data';

View File

@@ -35,6 +35,7 @@ if (open my $fh, '>', 'color.rc')
{
print $fh "data.location=.\n",
"color.project.x=red\n",
"color.project.none=green\n",
"color.alternate=\n",
"_forcecolor=1\n";
close $fh;
@@ -46,7 +47,7 @@ qx{../task rc:color.rc add nothing};
qx{../task rc:color.rc add project:x red};
my $output = qx{../task rc:color.rc list};
like ($output, qr/ (?!<\033\[\d\dm) .* nothing .* (?!>\033\[0m) /x, 'none');
like ($output, qr/ \033\[32m .* nothing .* \033\[0m /x, 'color.project.none');
like ($output, qr/ \033\[31m .* red .* \033\[0m /x, 'color.project.red');
# Cleanup.

View File

@@ -36,6 +36,7 @@ if (open my $fh, '>', 'color.rc')
print $fh "data.location=.\n",
"color.tagged=\n",
"color.alternate=\n",
"color.tag.none=yellow\n",
"color.tag.red=red\n",
"color.tag.green=green\n",
"_forcecolor=1\n";
@@ -49,7 +50,7 @@ qx{../task rc:color.rc add +red red};
qx{../task rc:color.rc add +green green};
my $output = qx{../task rc:color.rc list};
like ($output, qr/ (?!<\033\[\d\dm) .* nothing .* (?!>\033\[0m) /x, 'none');
like ($output, qr/ \033\[33m .* nothing .* \033\[0m /x, 'color.tag.none');
like ($output, qr/ \033\[31m .* red .* \033\[0m /x, 'color.tag.red');
like ($output, qr/ \033\[32m .* green .* \033\[0m /x, 'color.tag.green');

View File

@@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 7;
use Test::More tests => 9;
# Create the rc file.
if (open my $fh, '>', 'due.rc')
@@ -57,6 +57,13 @@ my $output = qx{../task rc:due.rc list};
like ($output, qr/\[31m.+$just.+\[0m/, 'one marked due');
like ($output, qr/\s+$almost\s+/, 'two not marked due');
qx{../task rc:due.rc add three due:today};
$output = qx{../task rc:due.rc list due:today};
like ($output, qr/three/, 'due:today works as a filter');
$output = qx{../task rc:due.rc list due.is:today};
like ($output, qr/three/, 'due.is:today works as a filter');
# Cleanup.
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');

View File

@@ -71,8 +71,8 @@ qx{../task rc:wait.rc add wait:tomorrow tomorrow};
$output = qx{../task rc:wait.rc ls};
unlike ($output, qr/tomorrow/ms, 'waiting task invisible');
$output = qx{../task rc:wait.rc ls wait:tomorrow};
like ($output, qr/tomorrow/ms, 'waiting task visible when specifically asked for it');
$output = qx{../task rc:wait.rc all status:waiting wait:tomorrow};
like ($output, qr/tomorrow/ms, 'waiting task visible when specifically queried');
# Cleanup.
unlink 'pending.data';