mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Unit Tests
- Removed useless setup/teardown tests, improving the signal to noise ratio.
This commit is contained in:
parent
7ab8d4db6d
commit
0a1bcbd48d
4 changed files with 5 additions and 33 deletions
|
@ -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, '>', 'recur.rc')
|
||||||
print $fh "data.location=.\n",
|
print $fh "data.location=.\n",
|
||||||
"defaultwidth=100\n";
|
"defaultwidth=100\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'recur.rc', 'Created recur.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Add a recurring task, then see how many future pending tasks are
|
# Add a recurring task, then see how many future pending tasks are
|
||||||
|
@ -58,11 +57,5 @@ like ($output, qr/No duplicates found/, 'No duplicate UUIDs detected');
|
||||||
|
|
||||||
# Cleanup.
|
# Cleanup.
|
||||||
unlink qw(pending.data completed.data undo.data backlog.data recur.rc);
|
unlink qw(pending.data completed.data undo.data backlog.data recur.rc);
|
||||||
ok (! -r 'pending.data' &&
|
|
||||||
! -r 'completed.data' &&
|
|
||||||
! -r 'undo.data' &&
|
|
||||||
! -r 'backlog.data' &&
|
|
||||||
! -r 'recur.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'};
|
||||||
|
@ -42,7 +42,6 @@ if (open my $fh, '>', 'recur.rc')
|
||||||
"report.desc.columns=id,recur,description\n",
|
"report.desc.columns=id,recur,description\n",
|
||||||
"report.desc.sort=recur-\n";
|
"report.desc.sort=recur-\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'recur.rc', 'Created recur.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create a few recurring tasks, and test the sort order of the recur column.
|
# Create a few recurring tasks, and test the sort order of the recur column.
|
||||||
|
@ -61,11 +60,5 @@ like ($output, qr/No duplicates found/, 'No duplicate UUIDs detected');
|
||||||
|
|
||||||
# Cleanup.
|
# Cleanup.
|
||||||
unlink qw(pending.data completed.data undo.data backlog.data recur.rc);
|
unlink qw(pending.data completed.data undo.data backlog.data recur.rc);
|
||||||
ok (! -r 'pending.data' &&
|
|
||||||
! -r 'completed.data' &&
|
|
||||||
! -r 'undo.data' &&
|
|
||||||
! -r 'backlog.data' &&
|
|
||||||
! -r 'recur.rc', 'Cleanup');
|
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 11;
|
use Test::More tests => 9;
|
||||||
|
|
||||||
# Ensure environment has no influence.
|
# Ensure environment has no influence.
|
||||||
delete $ENV{'TASKDATA'};
|
delete $ENV{'TASKDATA'};
|
||||||
|
@ -40,7 +40,6 @@ if (open my $fh, '>', 'recur.rc')
|
||||||
"confirmation=off\n",
|
"confirmation=off\n",
|
||||||
"recurrence.limit=1\n";
|
"recurrence.limit=1\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'recur.rc', 'Created recur.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create a recurring and non-recurring task.
|
# Create a recurring and non-recurring task.
|
||||||
|
@ -98,11 +97,5 @@ like ($output, qr/No duplicates found/, 'No duplicate UUIDs detected');
|
||||||
|
|
||||||
# Cleanup.
|
# Cleanup.
|
||||||
unlink qw(pending.data completed.data undo.data backlog.data recur.rc);
|
unlink qw(pending.data completed.data undo.data backlog.data recur.rc);
|
||||||
ok (! -r 'pending.data' &&
|
|
||||||
! -r 'completed.data' &&
|
|
||||||
! -r 'undo.data' &&
|
|
||||||
! -r 'backlog.data' &&
|
|
||||||
! -r 'recur.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, '>', 'recur.rc')
|
||||||
{
|
{
|
||||||
print $fh "data.location=.\n";
|
print $fh "data.location=.\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'recur.rc', 'Created recur.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create a few recurring tasks, and test the sort order of the recur column.
|
# Create a few recurring tasks, and test the sort order of the recur column.
|
||||||
|
@ -49,7 +48,7 @@ like ($output, qr/one/, 'recur weekdays');
|
||||||
$output = qx{../src/task rc:recur.rc info 1 2>&1};
|
$output = qx{../src/task rc:recur.rc info 1 2>&1};
|
||||||
like ($output, qr/Recurrence\s+weekdays/, 'task recurs every weekday');
|
like ($output, qr/Recurrence\s+weekdays/, 'task recurs every weekday');
|
||||||
|
|
||||||
qx{../src/task rc:recur.rc 1 do 2>&1};
|
qx{../src/task rc:recur.rc 1 done 2>&1};
|
||||||
$output = qx{../src/task rc:recur.rc list 2>&1};
|
$output = qx{../src/task rc:recur.rc list 2>&1};
|
||||||
|
|
||||||
$output = qx{../src/task rc:recur.rc diag 2>&1};
|
$output = qx{../src/task rc:recur.rc diag 2>&1};
|
||||||
|
@ -57,11 +56,5 @@ like ($output, qr/No duplicates found/, 'No duplicate UUIDs detected');
|
||||||
|
|
||||||
# Cleanup.
|
# Cleanup.
|
||||||
unlink qw(pending.data completed.data undo.data backlog.data recur.rc);
|
unlink qw(pending.data completed.data undo.data backlog.data recur.rc);
|
||||||
ok (! -r 'pending.data' &&
|
|
||||||
! -r 'completed.data' &&
|
|
||||||
! -r 'undo.data' &&
|
|
||||||
! -r 'backlog.data' &&
|
|
||||||
! -r 'recur.rc', 'Cleanup');
|
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue