mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Moved src/tests to test (cmake preperations)
This commit is contained in:
parent
02dcdf83b5
commit
17ef077e27
210 changed files with 0 additions and 0 deletions
86
test/bug.bulk.t
Executable file
86
test/bug.bulk.t
Executable file
|
@ -0,0 +1,86 @@
|
|||
#! /usr/bin/perl
|
||||
################################################################################
|
||||
## taskwarrior - a command line task list manager.
|
||||
##
|
||||
## Copyright 2006 - 2010, 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 => 15;
|
||||
|
||||
# Create the rc file.
|
||||
if (open my $fh, '>', 'bulk.rc')
|
||||
{
|
||||
print $fh "data.location=.\n",
|
||||
"confirmation=yes\n",
|
||||
"bulk=2\n";
|
||||
close $fh;
|
||||
ok (-r 'bulk.rc', 'Created bulk.rc');
|
||||
}
|
||||
|
||||
# Add some tasks with project, prioriy and due date, some with only due date.
|
||||
# Bulk add a project and priority to the tasks that were without.
|
||||
qx{../task rc:bulk.rc add t1 pro:p1 pri:H due:monday};
|
||||
qx{../task rc:bulk.rc add t2 pro:p1 pri:M due:tuesday};
|
||||
qx{../task rc:bulk.rc add t3 pro:p1 pri:L due:wednesday};
|
||||
qx{../task rc:bulk.rc add t4 due:thursday};
|
||||
qx{../task rc:bulk.rc add t5 due:friday};
|
||||
qx{../task rc:bulk.rc add t6 due:saturday};
|
||||
|
||||
my $output = qx{echo "quit"|../task rc:bulk.rc pro:p1 pri:M 4 5 6};
|
||||
like ($output, qr/Modified 0 tasks/, '"quit" prevents any further modifications');
|
||||
|
||||
$output = qx{echo "All"|../task rc:bulk.rc pro:p1 pri:M 4 5 6};
|
||||
unlike ($output, qr/Task 4 "t4"\n - No changes were made/, 'Task 4 modified');
|
||||
unlike ($output, qr/Task 5 "t5"\n - No changes were made/, 'Task 5 modified');
|
||||
unlike ($output, qr/Task 6 "t6"\n - No changes were made/, 'Task 6 modified');
|
||||
|
||||
$output = qx{../task rc:bulk.rc info 4};
|
||||
like ($output, qr/Project\s+p1/, 'project applied to 4');
|
||||
like ($output, qr/Priority\s+M/, 'priority applied to 4');
|
||||
|
||||
$output = qx{../task rc:bulk.rc info 5};
|
||||
like ($output, qr/Project\s+p1/, 'project applied to 5');
|
||||
like ($output, qr/Priority\s+M/, 'priority applied to 5');
|
||||
|
||||
$output = qx{../task rc:bulk.rc info 6};
|
||||
like ($output, qr/Project\s+p1/, 'project applied to 6');
|
||||
like ($output, qr/Priority\s+M/, 'priority applied to 6');
|
||||
|
||||
# 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 'bulk.rc';
|
||||
ok (!-r 'bulk.rc', 'Removed bulk.rc');
|
||||
|
||||
exit 0;
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue