Unit Tests

- Upgraded to use the new template.
This commit is contained in:
Paul Beckingham 2014-08-24 21:22:57 -04:00
parent e077b5bd34
commit bd12ae96e3

View file

@ -33,19 +33,23 @@ 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";
close $fh; close $fh;
} }
# Bug 869: lower case priorities aren't accepted. # Bug 869: lower case priorities aren't accepted.
qx{../src/task rc:bug.rc add foo pri:h 2>&1}; qx{../src/task rc:$rc add foo pri:h 2>&1};
my $output = qx{../src/task rc:bug.rc 1 info 2>&1}; my $output = qx{../src/task rc:$rc 1 info 2>&1};
like ($output, qr/Priority\s+H/, "pri:h --> pri:H"); like ($output, qr/Priority\s+H/, "$ut: pri:h --> pri:H");
# 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;