mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-25 21:27:19 +02:00
Unit Tests
- Upgraded to use the new template.
This commit is contained in:
parent
330d27c85a
commit
b9384be943
1 changed files with 10 additions and 6 deletions
|
@ -33,8 +33,12 @@ use Test::More tests => 2;
|
|||
delete $ENV{'TASKDATA'};
|
||||
delete $ENV{'TASKRC'};
|
||||
|
||||
use File::Basename;
|
||||
my $ut = basename ($0);
|
||||
my $rc = $ut . '.rc';
|
||||
|
||||
# Create the rc file.
|
||||
if (open my $fh, '>', 'bug.rc')
|
||||
if (open my $fh, '>', $rc)
|
||||
{
|
||||
print $fh "data.location=.\n",
|
||||
"dateformat.info=m/d/Y\n",
|
||||
|
@ -43,14 +47,14 @@ if (open my $fh, '>', 'bug.rc')
|
|||
}
|
||||
|
||||
# Setup: Add a recurring task, generate an instance, then add a project.
|
||||
qx{../src/task rc:bug.rc add foo due:today recur:daily until:eom 2>&1};
|
||||
my $output = qx{../src/task rc:bug.rc info 1 2>&1};
|
||||
qx{../src/task rc:$rc add foo due:today recur:daily until:eom 2>&1};
|
||||
my $output = qx{../src/task rc:$rc info 1 2>&1};
|
||||
|
||||
# Result: Make sure the 'until' date is rendered as a date, not an epoch.
|
||||
unlike ($output, qr/Until\s+\d{10}/, 'until is not shown as an epoch');
|
||||
like ($output, qr/Until\s+\d+\/\d+\/\d{4}/, 'until is shown as a date');
|
||||
unlike ($output, qr/Until\s+\d{10}/, "$ut: until is not shown as an epoch");
|
||||
like ($output, qr/Until\s+\d+\/\d+\/\d{4}/, "$ut: until is shown as a date");
|
||||
|
||||
# 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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue