mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Unit Tests
- Updated uda_value.t to the new template.
This commit is contained in:
parent
9551a3c554
commit
45e6512c02
1 changed files with 12 additions and 8 deletions
|
@ -33,8 +33,12 @@ use Test::More tests => 3;
|
||||||
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, '>', 'uda.rc')
|
if (open my $fh, '>', $rc)
|
||||||
{
|
{
|
||||||
print $fh "data.location=.\n",
|
print $fh "data.location=.\n",
|
||||||
"confirmation=off\n",
|
"confirmation=off\n",
|
||||||
|
@ -45,16 +49,16 @@ if (open my $fh, '>', 'uda.rc')
|
||||||
}
|
}
|
||||||
|
|
||||||
# Add tasks with valid and invalid UDA values.
|
# Add tasks with valid and invalid UDA values.
|
||||||
my $output = qx{../src/task rc:uda.rc add one smell:weak 2>&1};
|
my $output = qx{../src/task rc:$rc add one smell:weak 2>&1};
|
||||||
like ($output, qr/Created task 1/, 'UDA smell:weak allowed');
|
like ($output, qr/Created task 1/, "$ut: UDA smell:weak allowed");
|
||||||
|
|
||||||
$output = qx{../src/task rc:uda.rc add two smell:strong 2>&1};
|
$output = qx{../src/task rc:$rc add two smell:strong 2>&1};
|
||||||
like ($output, qr/Created task 2/, 'UDA smell:strong allowed');
|
like ($output, qr/Created task 2/, "$ut: UDA smell:strong allowed");
|
||||||
|
|
||||||
$output = qx{../src/task rc:uda.rc add three smell:toxic 2>&1};
|
$output = qx{../src/task rc:$rc add three smell:toxic 2>&1};
|
||||||
unlike ($output, qr/Created task 3/, 'UDA smell:toxic disallowed');
|
unlike ($output, qr/Created task 3/, "$ut: UDA smell:toxic disallowed");
|
||||||
|
|
||||||
# Cleanup.
|
# Cleanup.
|
||||||
unlink qw(pending.data completed.data undo.data backlog.data uda.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