Unit Tests

- Upgraded to use the new template.
This commit is contained in:
Paul Beckingham
2014-08-31 11:57:06 -04:00
parent 8b682d8565
commit 3c29e81995

View File

@@ -33,20 +33,24 @@ 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, '>', 'backslash.rc') if (open my $fh, '>', $rc)
{ {
print $fh "data.location=.\n"; print $fh "data.location=.\n";
close $fh; close $fh;
} }
# Add a description with a backslash. # Add a description with a backslash.
qx{../src/task rc:backslash.rc add \\\\ 2>&1}; qx{../src/task rc:$rc add \\\\ 2>&1};
my $output = qx{../src/task rc:backslash.rc ls 2>&1}; my $output = qx{../src/task rc:$rc ls 2>&1};
like ($output, qr/\\/, 'Backslash preserved, no parsing issues'); like ($output, qr/\\/, "$ut: Backslash preserved, no parsing issues");
# Cleanup. # Cleanup.
unlink qw(pending.data completed.data undo.data backlog.data backslash.rc); unlink qw(pending.data completed.data undo.data backlog.data), $rc;
exit 0; exit 0;
################################################################################ ################################################################################