Enhancement

- Clarify the dateformat related variables for 'task information'.
This commit is contained in:
Louis-Claude Canon 2012-05-16 14:42:11 +02:00 committed by Paul Beckingham
parent 84e1d0e7d2
commit ba992a631e
7 changed files with 20 additions and 21 deletions

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 6;
use Test::More tests => 5;
# Create the rc file.
if (open my $fh, '>', 'bug.rc')
@ -47,18 +47,14 @@ if (open my $fh, '>', 'bug.rc')
qx{../src/task rc:bug.rc add test};
qx{../src/task rc:bug.rc test start};
# Test that report.info.dateformat has precedence over dateformat.report and
# dateformat and that no other format is applied
my $output = qx{../src/task rc:bug.rc test info rc.dateformat:m/d/Y rc.dateformat.report:m/d/Y rc.report.info.dateformat:__};
like ($output, qr/__/ms, 'Date formatted according to report.info.dateformat');
# Test that dateformat.info has precedence over dateformat and that no other
# format is applied
my $output = qx{../src/task rc:bug.rc test info rc.dateformat:m/d/Y rc.dateformat.info:__};
like ($output, qr/__/ms, 'Date formatted according to dateformat.info');
unlike ($output, qr/[0-9]*\/[0-9]*\/20[0-9]*/ms, 'No date is incorrectly formatted');
# Similar for dateformat.report (no need to check that another format is applied again)
$output = qx{../src/task rc:bug.rc test info rc.dateformat:m/d/Y rc.dateformat.report:__ rc.report.info.dateformat:};
like ($output, qr/__/ms, 'Date formatted according to dateformat.report');
# Similar for dateformat
$output = qx{../src/task rc:bug.rc test info rc.dateformat:__ rc.dateformat.report: rc.report.info.dateformat:};
$output = qx{../src/task rc:bug.rc test info rc.dateformat:__ rc.dateformat.info:};
like ($output, qr/__/ms, 'Date formatted according to dateformat');
### Cleanup.

View file

@ -35,6 +35,7 @@ if (open my $fh, '>', 'date1.rc')
{
print $fh "data.location=.\n",
"dateformat=YMD\n",
"dateformat.info=YMD\n",
"dateformat.report=YMD\n";
close $fh;
ok (-r 'date1.rc', 'Created date1.rc');
@ -44,6 +45,7 @@ if (open my $fh, '>', 'date2.rc')
{
print $fh "data.location=.\n",
"dateformat=m/d/y\n",
"dateformat.info=m/d/y\n",
"dateformat.report=m/d/y\n";
close $fh;
ok (-r 'date2.rc', 'Created date2.rc');
@ -55,6 +57,7 @@ if (open my $fh, '>', 'date3.rc')
"dateformat=m/d/y\n",
"dateformat=m/d/y\n",
"weekstart=Monday\n",
"dateformat.info=A D B Y (vV)\n",
"dateformat.report=A D B Y (vV)\n";
close $fh;
ok (-r 'date3.rc', 'Created date3.rc');

View file

@ -35,7 +35,7 @@ if (open my $fh, '>', 'dom.rc')
{
print $fh "data.location=.\n",
"dateformat=YMD\n",
"report.info.dateformat=YMD\n";
"dateformat.info=YMD\n";
close $fh;
ok (-r 'dom.rc', 'Created dom.rc');
}