mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-20 04:13:07 +02:00
Unit Tests
- Removed useless setup/teardown tests, improving the signal to noise ratio.
This commit is contained in:
parent
fbdceac548
commit
1c5a9f70cb
6 changed files with 6 additions and 48 deletions
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 7;
|
use Test::More tests => 5;
|
||||||
|
|
||||||
# Ensure environment has no influence.
|
# Ensure environment has no influence.
|
||||||
delete $ENV{'TASKDATA'};
|
delete $ENV{'TASKDATA'};
|
||||||
|
@ -43,7 +43,6 @@ if (open my $fh, '>', 'custom.rc')
|
||||||
"report.foo.sort=id+\n",
|
"report.foo.sort=id+\n",
|
||||||
"report.foo.filter=project:A\n";
|
"report.foo.filter=project:A\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'custom.rc', 'Created custom.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Generate the help screen, and locate the custom report on it.
|
# Generate the help screen, and locate the custom report on it.
|
||||||
|
@ -60,11 +59,5 @@ unlike ($output, qr/two/, 'custom filter excluded');
|
||||||
|
|
||||||
# Cleanup.
|
# Cleanup.
|
||||||
unlink qw(pending.data completed.data undo.data backlog.data custom.rc);
|
unlink qw(pending.data completed.data undo.data backlog.data custom.rc);
|
||||||
ok (! -r 'pending.data' &&
|
|
||||||
! -r 'completed.data' &&
|
|
||||||
! -r 'undo.data' &&
|
|
||||||
! -r 'backlog.data' &&
|
|
||||||
! -r 'custom.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, '>', 'limit.rc')
|
||||||
print $fh "data.location=.\n",
|
print $fh "data.location=.\n",
|
||||||
"verbose=affected\n";
|
"verbose=affected\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'limit.rc', 'Created limit.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Add a large number of tasks (> 25).
|
# Add a large number of tasks (> 25).
|
||||||
|
@ -99,11 +98,5 @@ like ($output, qr/^30 tasks, truncated to 22 lines$/ms, 'limited to page');
|
||||||
|
|
||||||
# Cleanup.
|
# Cleanup.
|
||||||
unlink qw(pending.data completed.data undo.data backlog.data limit.rc);
|
unlink qw(pending.data completed.data undo.data backlog.data limit.rc);
|
||||||
ok (! -r 'pending.data' &&
|
|
||||||
! -r 'completed.data' &&
|
|
||||||
! -r 'undo.data' &&
|
|
||||||
! -r 'backlog.data' &&
|
|
||||||
! -r 'limit.rc', 'Cleanup');
|
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 8;
|
use Test::More tests => 6;
|
||||||
|
|
||||||
# Ensure environment has no influence.
|
# Ensure environment has no influence.
|
||||||
delete $ENV{'TASKDATA'};
|
delete $ENV{'TASKDATA'};
|
||||||
|
@ -38,7 +38,6 @@ if (open my $fh, '>', 'projects.rc')
|
||||||
{
|
{
|
||||||
print $fh "data.location=.\n";
|
print $fh "data.location=.\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'projects.rc', 'Created projects.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create a data set of two tasks, with unique project names, one
|
# Create a data set of two tasks, with unique project names, one
|
||||||
|
@ -61,11 +60,5 @@ like ($output, qr/p2/, 'p2 listed');
|
||||||
|
|
||||||
# Cleanup.
|
# Cleanup.
|
||||||
unlink qw(pending.data completed.data undo.data backlog.data projects.rc);
|
unlink qw(pending.data completed.data undo.data backlog.data projects.rc);
|
||||||
ok (! -r 'pending.data' &&
|
|
||||||
! -r 'completed.data' &&
|
|
||||||
! -r 'undo.data' &&
|
|
||||||
! -r 'backlog.data' &&
|
|
||||||
! -r 'projects.rc', 'Cleanup');
|
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 8;
|
use Test::More tests => 6;
|
||||||
|
|
||||||
# Ensure environment has no influence.
|
# Ensure environment has no influence.
|
||||||
delete $ENV{'TASKDATA'};
|
delete $ENV{'TASKDATA'};
|
||||||
|
@ -39,7 +39,6 @@ if (open my $fh, '>', 'tags.rc')
|
||||||
print $fh "data.location=.\n",
|
print $fh "data.location=.\n",
|
||||||
"defaultwidth=100\n";
|
"defaultwidth=100\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'tags.rc', 'Created tags.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create a data set of two tasks, with unique project names, one
|
# Create a data set of two tasks, with unique project names, one
|
||||||
|
@ -61,11 +60,5 @@ like ($output, qr/t2/, 't2 listed');
|
||||||
|
|
||||||
# Cleanup.
|
# Cleanup.
|
||||||
unlink qw(pending.data completed.data undo.data backlog.data tags.rc);
|
unlink qw(pending.data completed.data undo.data backlog.data tags.rc);
|
||||||
ok (! -r 'pending.data' &&
|
|
||||||
! -r 'completed.data' &&
|
|
||||||
! -r 'undo.data' &&
|
|
||||||
! -r 'backlog.data' &&
|
|
||||||
! -r 'tags.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, '>', 'log.rc')
|
||||||
print $fh "data.location=.\n",
|
print $fh "data.location=.\n",
|
||||||
"confirmation=off\n";
|
"confirmation=off\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'log.rc', 'Created log.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Test the log command.
|
# Test the log command.
|
||||||
|
@ -49,11 +48,5 @@ like ($output, qr/This is a test/, 'log description');
|
||||||
|
|
||||||
# Cleanup.
|
# Cleanup.
|
||||||
unlink qw(pending.data completed.data undo.data backlog.data log.rc);
|
unlink qw(pending.data completed.data undo.data backlog.data log.rc);
|
||||||
ok (! -r 'pending.data' &&
|
|
||||||
! -r 'completed.data' &&
|
|
||||||
! -r 'undo.data' &&
|
|
||||||
! -r 'backlog.data' &&
|
|
||||||
! -r 'log.rc', 'Cleanup');
|
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 4;
|
use Test::More tests => 2;
|
||||||
|
|
||||||
# Ensure environment has no influence.
|
# Ensure environment has no influence.
|
||||||
delete $ENV{'TASKDATA'};
|
delete $ENV{'TASKDATA'};
|
||||||
|
@ -39,7 +39,6 @@ if (open my $fh, '>', 'next.rc')
|
||||||
print $fh "data.location=.\n",
|
print $fh "data.location=.\n",
|
||||||
"next=1\n";
|
"next=1\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'next.rc', 'Created next.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Add two tasks for each of two projects, then run next. There should be only
|
# Add two tasks for each of two projects, then run next. There should be only
|
||||||
|
@ -55,11 +54,5 @@ like ($output, qr/BH/, 'BH shown');
|
||||||
|
|
||||||
# Cleanup.
|
# Cleanup.
|
||||||
unlink qw(pending.data completed.data undo.data backlog.data next.rc);
|
unlink qw(pending.data completed.data undo.data backlog.data next.rc);
|
||||||
ok (! -r 'pending.data' &&
|
|
||||||
! -r 'completed.data' &&
|
|
||||||
! -r 'undo.data' &&
|
|
||||||
! -r 'backlog.data' &&
|
|
||||||
! -r 'next.rc', 'Cleanup');
|
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue