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
f7b5ba2312
commit
e077b5bd34
1 changed files with 9 additions and 5 deletions
|
@ -33,8 +33,12 @@ 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;
|
||||||
|
@ -46,11 +50,11 @@ if (open my $fh, '>', 'pending.data')
|
||||||
close $fh;
|
close $fh;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $output = qx{../src/task rc:bug.rc list 2>&1};
|
my $output = qx{../src/task rc:$rc list 2>&1};
|
||||||
like ($output, qr/One/, 'task listed');
|
like ($output, qr/One/, "$ut: task listed");
|
||||||
unlike ($output, qr/The recurrence value '1m' is not valid\./, 'recu:1m => no error');
|
unlike ($output, qr/The recurrence value '1m' is not valid\./, "$ut: recu:1m => no error");
|
||||||
|
|
||||||
# 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