mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Unit Tests
- Upgraded to use the new template.
This commit is contained in:
parent
ba09dc3198
commit
f7e5653199
1 changed files with 9 additions and 5 deletions
|
@ -33,18 +33,22 @@ use Test::More tests => 2;
|
||||||
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 #555 - log with a project segfaults.
|
# Bug #555 - log with a project segfaults.
|
||||||
my $output = qx{../src/task rc:bug.rc log description project:p 2>&1};
|
my $output = qx{../src/task rc:$rc log description project:p 2>&1};
|
||||||
like ($output, qr/^Logged task.$/m, 'task logged');
|
like ($output, qr/^Logged task.$/m, "$ut: task logged");
|
||||||
unlike ($output, qr/Segmentation fault/, 'no segfault from log with project');
|
unlike ($output, qr/Segmentation fault/, "$ut: no segfault from log with project");
|
||||||
|
|
||||||
# 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