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
1237a4af10
commit
6be552939a
1 changed files with 14 additions and 10 deletions
|
@ -33,8 +33,12 @@ use Test::More tests => 4;
|
||||||
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",
|
||||||
"confirmation=off\n";
|
"confirmation=off\n";
|
||||||
|
@ -42,19 +46,19 @@ if (open my $fh, '>', 'bug.rc')
|
||||||
}
|
}
|
||||||
|
|
||||||
# Bug 899: task log does not behave correctly when logging into a project
|
# Bug 899: task log does not behave correctly when logging into a project
|
||||||
my $output = qx{../src/task rc:bug.rc add one pro:A 2>&1 >/dev/null};
|
my $output = qx{../src/task rc:$rc add one pro:A 2>&1 >/dev/null};
|
||||||
like ($output, qr/ 0% complete \(1 of 1 /, '1 of 1 tasks remaining - 0%');
|
like ($output, qr/ 0% complete \(1 of 1 /, "$ut: 1 of 1 tasks remaining - 0%");
|
||||||
|
|
||||||
$output = qx{../src/task rc:bug.rc add two pro:A 2>&1 >/dev/null};
|
$output = qx{../src/task rc:$rc add two pro:A 2>&1 >/dev/null};
|
||||||
like ($output, qr/ 0% complete \(2 of 2 /, '2 of 2 tasks remaining - 0%');
|
like ($output, qr/ 0% complete \(2 of 2 /, "$ut: 2 of 2 tasks remaining - 0%");
|
||||||
|
|
||||||
$output = qx{../src/task rc:bug.rc 1 done 2>&1 >/dev/null};
|
$output = qx{../src/task rc:$rc 1 done 2>&1 >/dev/null};
|
||||||
like ($output, qr/ 50% complete \(1 of 2 /, '1 of 2 tasks remaining - 50%');
|
like ($output, qr/ 50% complete \(1 of 2 /, "$ut: 1 of 2 tasks remaining - 50%");
|
||||||
|
|
||||||
$output = qx{../src/task rc:bug.rc log three pro:A 2>&1 >/dev/null};
|
$output = qx{../src/task rc:$rc log three pro:A 2>&1 >/dev/null};
|
||||||
like ($output, qr/ 66% complete \(1 of 3 /, '1 of 3 tasks remaining - 66%');
|
like ($output, qr/ 66% complete \(1 of 3 /, "$ut: 1 of 3 tasks remaining - 66%");
|
||||||
|
|
||||||
# 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