mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Unit Tests
- Updated to conform to template.
This commit is contained in:
parent
45d41bbe75
commit
43c097e10e
1 changed files with 10 additions and 6 deletions
|
@ -33,11 +33,15 @@ use Test::More tests => 1;
|
||||||
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, '>', 'bug.rc')
|
if (open my $fh, '>', $rc)
|
||||||
{
|
{
|
||||||
print $fh "data.location=.\n",
|
print $fh "data.location=.\n",
|
||||||
"confirmation=no\n",
|
"confirmation=off\n",
|
||||||
"dateformat=a b D Y\n";
|
"dateformat=a b D Y\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
}
|
}
|
||||||
|
@ -45,13 +49,13 @@ if (open my $fh, '>', 'bug.rc')
|
||||||
# Bug 628: task wait: with non-standard dateformat bug
|
# Bug 628: task wait: with non-standard dateformat bug
|
||||||
|
|
||||||
# Setup: Add a task
|
# Setup: Add a task
|
||||||
qx{../src/task rc:bug.rc add wait:"Wed Jan 01 2030" A buggy task 2>&1};
|
qx{../src/task rc:$rc add wait:"Wed Jan 01 2030" A buggy task 2>&1};
|
||||||
|
|
||||||
# Result: Immediately delete the created task
|
# Result: Immediately delete the created task
|
||||||
my $output = qx{../src/task rc:bug.rc waiting 2>&1};
|
my $output = qx{../src/task rc:$rc waiting 2>&1};
|
||||||
like ($output, qr/Jan 01 2020/ms, 'a b D Y dateformat correctly parsed.');
|
like ($output, qr/Jan 01 2020/ms, "$ut: a b D Y dateformat correctly parsed.");
|
||||||
|
|
||||||
# Cleanup.
|
# Cleanup.
|
||||||
unlink qw(pending.data completed.data undo.data backlog.data bug.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