mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Unit Tests
- Updated to use new template.
This commit is contained in:
parent
e81a95c8f7
commit
a2a69e94fc
1 changed files with 13 additions and 9 deletions
|
@ -33,8 +33,12 @@ use Test::More tests => 3;
|
||||||
delete $ENV{'TASKDATA'};
|
delete $ENV{'TASKDATA'};
|
||||||
delete $ENV{'TASKRC'};
|
delete $ENV{'TASKRC'};
|
||||||
|
|
||||||
|
use File::Basename;
|
||||||
|
my $ut = basename ($0);
|
||||||
|
my $rc = $ut . '.rc';
|
||||||
|
|
||||||
# Create the rc file.
|
# Create the rc file.
|
||||||
if (open my $fh, '>', 'due.rc')
|
if (open my $fh, '>', $rc)
|
||||||
{
|
{
|
||||||
print $fh "data.location=.\n",
|
print $fh "data.location=.\n",
|
||||||
"due=4\n";
|
"due=4\n";
|
||||||
|
@ -43,15 +47,15 @@ if (open my $fh, '>', 'due.rc')
|
||||||
|
|
||||||
# Add an overdue task, a due task, and a regular task. The "overdue" report
|
# Add an overdue task, a due task, and a regular task. The "overdue" report
|
||||||
# should list only the one task.
|
# should list only the one task.
|
||||||
qx{../src/task rc:due.rc add due:yesterday one 2>&1};
|
qx{../src/task rc:$rc add due:yesterday one 2>&1};
|
||||||
qx{../src/task rc:due.rc add due:tomorrow two 2>&1};
|
qx{../src/task rc:$rc add due:tomorrow two 2>&1};
|
||||||
qx{../src/task rc:due.rc add due:30d three 2>&1};
|
qx{../src/task rc:$rc add due:30d three 2>&1};
|
||||||
my $output = qx{../src/task rc:due.rc overdue 2>&1};
|
my $output = qx{../src/task rc:$rc overdue 2>&1};
|
||||||
like ($output, qr/one/, 'overdue: task 1 shows up');
|
like ($output, qr/one/, "$ut: overdue: task 1 shows up");
|
||||||
unlike ($output, qr/two/, 'overdue: task 2 does not show up');
|
unlike ($output, qr/two/, "$ut: overdue: task 2 does not show up");
|
||||||
unlike ($output, qr/three/, 'overdue: task 3 does not show up');
|
unlike ($output, qr/three/, "$ut: overdue: task 3 does not show up");
|
||||||
|
|
||||||
# Cleanup.
|
# Cleanup.
|
||||||
unlink qw(pending.data completed.data undo.data backlog.data due.rc);
|
unlink qw(pending.data completed.data undo.data backlog.data), $rc;
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue