Unit Tests
- Removed useless setup/teardown tests, improving the signal to noise ratio.
This commit is contained in:
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 17;
|
use Test::More tests => 15;
|
||||||
|
|
||||||
# Ensure environment has no influence.
|
# Ensure environment has no influence.
|
||||||
delete $ENV{'TASKDATA'};
|
delete $ENV{'TASKDATA'};
|
||||||
@@ -39,7 +39,6 @@ if (open my $fh, '>', 'bug.rc')
|
|||||||
print $fh "data.location=.\n",
|
print $fh "data.location=.\n",
|
||||||
"confirmation=off\n";
|
"confirmation=off\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'bug.rc', 'Created bug.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Bug 906: escaping runs amok
|
# Bug 906: escaping runs amok
|
||||||
@@ -73,11 +72,5 @@ like ($output, qr/two/, 'list - two included');
|
|||||||
|
|
||||||
# Cleanup.
|
# Cleanup.
|
||||||
unlink qw(pending.data completed.data undo.data backlog.data bug.rc);
|
unlink qw(pending.data completed.data undo.data backlog.data bug.rc);
|
||||||
ok (! -r 'pending.data' &&
|
|
||||||
! -r 'completed.data' &&
|
|
||||||
! -r 'undo.data' &&
|
|
||||||
! -r 'backlog.data' &&
|
|
||||||
! -r 'bug.rc', 'Cleanup');
|
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 6;
|
use Test::More tests => 4;
|
||||||
|
|
||||||
# Ensure environment has no influence.
|
# Ensure environment has no influence.
|
||||||
delete $ENV{'TASKDATA'};
|
delete $ENV{'TASKDATA'};
|
||||||
@@ -39,7 +39,6 @@ if (open my $fh, '>', 'bug.rc')
|
|||||||
print $fh "data.location=.\n",
|
print $fh "data.location=.\n",
|
||||||
"confirmation=off\n";
|
"confirmation=off\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'bug.rc', 'Created bug.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Bug 917: escaping runs amok
|
# Bug 917: escaping runs amok
|
||||||
@@ -56,11 +55,5 @@ like ($output, qr/four "five" six/, 'Double quote preserved after modification')
|
|||||||
|
|
||||||
# Cleanup.
|
# Cleanup.
|
||||||
unlink qw(pending.data completed.data undo.data backlog.data bug.rc);
|
unlink qw(pending.data completed.data undo.data backlog.data bug.rc);
|
||||||
ok (! -r 'pending.data' &&
|
|
||||||
! -r 'completed.data' &&
|
|
||||||
! -r 'undo.data' &&
|
|
||||||
! -r 'backlog.data' &&
|
|
||||||
! -r 'bug.rc', 'Cleanup');
|
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 5;
|
use Test::More tests => 3;
|
||||||
|
|
||||||
# Ensure environment has no influence.
|
# Ensure environment has no influence.
|
||||||
delete $ENV{'TASKDATA'};
|
delete $ENV{'TASKDATA'};
|
||||||
@@ -38,7 +38,6 @@ if (open my $fh, '>', 'bug.rc')
|
|||||||
{
|
{
|
||||||
print $fh "data.location=.\n";
|
print $fh "data.location=.\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'bug.rc', 'Created bug.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Bug 924: '1.0' --> '1.0000'
|
# Bug 924: '1.0' --> '1.0000'
|
||||||
@@ -52,11 +51,5 @@ like ($output, qr/\s3.0\s/ms, 'Double quote floating point preserved');
|
|||||||
|
|
||||||
# Cleanup.
|
# Cleanup.
|
||||||
unlink qw(pending.data completed.data undo.data backlog.data bug.rc);
|
unlink qw(pending.data completed.data undo.data backlog.data bug.rc);
|
||||||
ok (! -r 'pending.data' &&
|
|
||||||
! -r 'completed.data' &&
|
|
||||||
! -r 'undo.data' &&
|
|
||||||
! -r 'backlog.data' &&
|
|
||||||
! -r 'bug.rc', 'Cleanup');
|
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 12;
|
use Test::More tests => 10;
|
||||||
|
|
||||||
# Ensure environment has no influence.
|
# Ensure environment has no influence.
|
||||||
delete $ENV{'TASKDATA'};
|
delete $ENV{'TASKDATA'};
|
||||||
@@ -39,7 +39,6 @@ if (open my $fh, '>', 'bug.rc')
|
|||||||
print $fh "data.location=.\n",
|
print $fh "data.location=.\n",
|
||||||
"confirmation=off\n";
|
"confirmation=off\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'bug.rc', 'Created bug.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Bug 932: Modifying recurring task's recurrence period - strange outcome
|
# Bug 932: Modifying recurring task's recurrence period - strange outcome
|
||||||
@@ -69,11 +68,5 @@ like ($output, qr/No duplicates found/, 'No duplicate UUIDs detected');
|
|||||||
|
|
||||||
# Cleanup.
|
# Cleanup.
|
||||||
unlink qw(pending.data completed.data undo.data backlog.data bug.rc);
|
unlink qw(pending.data completed.data undo.data backlog.data bug.rc);
|
||||||
ok (! -r 'pending.data' &&
|
|
||||||
! -r 'completed.data' &&
|
|
||||||
! -r 'undo.data' &&
|
|
||||||
! -r 'backlog.data' &&
|
|
||||||
! -r 'bug.rc', 'Cleanup');
|
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 6;
|
use Test::More tests => 4;
|
||||||
|
|
||||||
# Ensure environment has no influence.
|
# Ensure environment has no influence.
|
||||||
delete $ENV{'TASKDATA'};
|
delete $ENV{'TASKDATA'};
|
||||||
@@ -39,7 +39,6 @@ if (open my $fh, '>', 'bug.rc')
|
|||||||
print $fh "data.location=.\n",
|
print $fh "data.location=.\n",
|
||||||
"confirmation=off\n";
|
"confirmation=off\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'bug.rc', 'Created bug.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Bug 954 - Deleting task by uuid attempts deleting all tasks
|
# Bug 954 - Deleting task by uuid attempts deleting all tasks
|
||||||
@@ -60,10 +59,4 @@ like ($output, qr/bar/ms, 'Task bar not deleted');
|
|||||||
|
|
||||||
# Cleanup.
|
# Cleanup.
|
||||||
unlink qw(pending.data completed.data undo.data backlog.data bug.rc);
|
unlink qw(pending.data completed.data undo.data backlog.data bug.rc);
|
||||||
ok (! -r 'pending.data' &&
|
|
||||||
! -r 'completed.data' &&
|
|
||||||
! -r 'undo.data' &&
|
|
||||||
! -r 'backlog.data' &&
|
|
||||||
! -r 'bug.rc', 'Cleanup');
|
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 5;
|
use Test::More tests => 3;
|
||||||
|
|
||||||
# Ensure environment has no influence.
|
# Ensure environment has no influence.
|
||||||
delete $ENV{'TASKDATA'};
|
delete $ENV{'TASKDATA'};
|
||||||
@@ -39,7 +39,6 @@ if (open my $fh, '>', 'bug.rc')
|
|||||||
print $fh "data.location=.\n",
|
print $fh "data.location=.\n",
|
||||||
"confirmation=on\n";
|
"confirmation=on\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'bug.rc', 'Created bug.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Bug 955: When deleting the child of a recurring task, taskwarrior does not ask
|
# Bug 955: When deleting the child of a recurring task, taskwarrior does not ask
|
||||||
@@ -58,11 +57,5 @@ like ($output, qr/^No matches/ms, 'No tasks remaining');
|
|||||||
|
|
||||||
# Cleanup.
|
# Cleanup.
|
||||||
unlink qw(pending.data completed.data undo.data backlog.data bug.rc);
|
unlink qw(pending.data completed.data undo.data backlog.data bug.rc);
|
||||||
ok (! -r 'pending.data' &&
|
|
||||||
! -r 'completed.data' &&
|
|
||||||
! -r 'undo.data' &&
|
|
||||||
! -r 'backlog.data' &&
|
|
||||||
! -r 'bug.rc', 'Cleanup');
|
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 14;
|
use Test::More tests => 12;
|
||||||
|
|
||||||
# Ensure environment has no influence.
|
# Ensure environment has no influence.
|
||||||
delete $ENV{'TASKDATA'};
|
delete $ENV{'TASKDATA'};
|
||||||
@@ -38,7 +38,6 @@ if (open my $fh, '>', 'bug.rc')
|
|||||||
{
|
{
|
||||||
print $fh "data.location=.\n";
|
print $fh "data.location=.\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'bug.rc', 'Created bug.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Bug 956 - 'task ids' prints the header, which prevents using the command in
|
# Bug 956 - 'task ids' prints the header, which prevents using the command in
|
||||||
@@ -72,12 +71,6 @@ $output = qx{TASKRC=bug.rc ../src/task _ids 2>/dev/null};
|
|||||||
like ($output, qr/^[0-9a-f-]*$/m, 'UUID shown');
|
like ($output, qr/^[0-9a-f-]*$/m, 'UUID shown');
|
||||||
unlike ($output, qr/TASKRC/ms, 'The header does not appear with "_ids" (2>/dev/null)');
|
unlike ($output, qr/TASKRC/ms, 'The header does not appear with "_ids" (2>/dev/null)');
|
||||||
|
|
||||||
### Cleanup.
|
# Cleanup.
|
||||||
unlink qw(pending.data completed.data undo.data backlog.data bug.rc);
|
unlink qw(pending.data completed.data undo.data backlog.data bug.rc);
|
||||||
ok (! -r 'pending.data' &&
|
|
||||||
! -r 'completed.data' &&
|
|
||||||
! -r 'undo.data' &&
|
|
||||||
! -r 'backlog.data' &&
|
|
||||||
! -r 'bug.rc', 'Cleanup');
|
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 3;
|
use Test::More tests => 1;
|
||||||
|
|
||||||
# Ensure environment has no influence.
|
# Ensure environment has no influence.
|
||||||
delete $ENV{'TASKDATA'};
|
delete $ENV{'TASKDATA'};
|
||||||
@@ -39,7 +39,6 @@ if (open my $fh, '>', 'bug.rc')
|
|||||||
print $fh "data.location=.\n",
|
print $fh "data.location=.\n",
|
||||||
"recurrence.limit=1\n";
|
"recurrence.limit=1\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'bug.rc', 'Created bug.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Bug 972: A recurrence period of "7" is interpreted as "7s", not "7d" as
|
# Bug 972: A recurrence period of "7" is interpreted as "7s", not "7d" as
|
||||||
@@ -49,11 +48,5 @@ like ($output, qr/ not recognized as valid, /, 'recur:2 is not valid');
|
|||||||
|
|
||||||
# Cleanup.
|
# Cleanup.
|
||||||
unlink qw(pending.data completed.data undo.data backlog.data bug.rc);
|
unlink qw(pending.data completed.data undo.data backlog.data bug.rc);
|
||||||
ok (! -r 'pending.data' &&
|
|
||||||
! -r 'completed.data' &&
|
|
||||||
! -r 'undo.data' &&
|
|
||||||
! -r 'backlog.data' &&
|
|
||||||
! -r 'bug.rc', 'Cleanup');
|
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 5;
|
use Test::More tests => 3;
|
||||||
|
|
||||||
# Ensure environment has no influence.
|
# Ensure environment has no influence.
|
||||||
delete $ENV{'TASKDATA'};
|
delete $ENV{'TASKDATA'};
|
||||||
@@ -39,7 +39,6 @@ if (open my $fh, '>', 'bug.rc')
|
|||||||
print $fh "data.location=.\n",
|
print $fh "data.location=.\n",
|
||||||
"verbose=nothing\n";
|
"verbose=nothing\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'bug.rc', 'Created bug.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Bug 986 - 'task info' does not format date using dateformat.report
|
# Bug 986 - 'task info' does not format date using dateformat.report
|
||||||
@@ -60,12 +59,6 @@ unlike ($output, qr/[0-9]*\/[0-9]*\/20[0-9]*/ms, 'No date is incorrectly formatt
|
|||||||
$output = qx{../src/task rc:bug.rc test info rc.dateformat:__ rc.dateformat.info: 2>&1};
|
$output = qx{../src/task rc:bug.rc test info rc.dateformat:__ rc.dateformat.info: 2>&1};
|
||||||
like ($output, qr/__/ms, 'Date formatted according to dateformat');
|
like ($output, qr/__/ms, 'Date formatted according to dateformat');
|
||||||
|
|
||||||
### Cleanup.
|
# Cleanup.
|
||||||
unlink qw(pending.data completed.data undo.data backlog.data bug.rc);
|
unlink qw(pending.data completed.data undo.data backlog.data bug.rc);
|
||||||
ok (! -r 'pending.data' &&
|
|
||||||
! -r 'completed.data' &&
|
|
||||||
! -r 'undo.data' &&
|
|
||||||
! -r 'backlog.data' &&
|
|
||||||
! -r 'bug.rc', 'Cleanup');
|
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 3;
|
use Test::More tests => 1;
|
||||||
|
|
||||||
# Ensure environment has no influence.
|
# Ensure environment has no influence.
|
||||||
delete $ENV{'TASKDATA'};
|
delete $ENV{'TASKDATA'};
|
||||||
@@ -41,7 +41,6 @@ if (open my $fh, '>', 'color.rc')
|
|||||||
"color.tagged=red\n",
|
"color.tagged=red\n",
|
||||||
"_forcecolor=1\n";
|
"_forcecolor=1\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'color.rc', 'Created color.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Bug that colored any task with both priority:L and a tag as though
|
# Bug that colored any task with both priority:L and a tag as though
|
||||||
@@ -53,11 +52,5 @@ like ($output, qr/ \033\[32m .* test .* \033\[0m /x, 'Colored with the pr
|
|||||||
|
|
||||||
# Cleanup.
|
# Cleanup.
|
||||||
unlink qw(pending.data completed.data undo.data backlog.data color.rc);
|
unlink qw(pending.data completed.data undo.data backlog.data color.rc);
|
||||||
ok (! -r 'pending.data' &&
|
|
||||||
! -r 'completed.data' &&
|
|
||||||
! -r 'undo.data' &&
|
|
||||||
! -r 'backlog.data' &&
|
|
||||||
! -r 'color.rc', 'Cleanup');
|
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 5;
|
use Test::More tests => 3;
|
||||||
|
|
||||||
# Ensure environment has no influence.
|
# Ensure environment has no influence.
|
||||||
delete $ENV{'TASKDATA'};
|
delete $ENV{'TASKDATA'};
|
||||||
@@ -39,7 +39,6 @@ if (open my $fh, '>', 'bug.rc')
|
|||||||
print $fh "data.location=.\n",
|
print $fh "data.location=.\n",
|
||||||
"confirmation=off\n";
|
"confirmation=off\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'bug.rc', 'Created bug.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Bug 991 - A deprecated configuration variable is checked
|
# Bug 991 - A deprecated configuration variable is checked
|
||||||
@@ -54,10 +53,4 @@ unlike ($output, qr/unrecognized/ms, 'No unrecognized variable');
|
|||||||
|
|
||||||
## Cleanup.
|
## Cleanup.
|
||||||
unlink qw(pending.data completed.data undo.data backlog.data bug.rc);
|
unlink qw(pending.data completed.data undo.data backlog.data bug.rc);
|
||||||
ok (! -r 'pending.data' &&
|
|
||||||
! -r 'completed.data' &&
|
|
||||||
! -r 'undo.data' &&
|
|
||||||
! -r 'backlog.data' &&
|
|
||||||
! -r 'bug.rc', 'Cleanup');
|
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user