mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Unit Tests
- Removed useless setup/teardown tests, improving the signal to noise ratio.
This commit is contained in:
parent
fb11379630
commit
7f08ec5a63
5 changed files with 5 additions and 40 deletions
|
@ -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'};
|
||||||
|
@ -42,7 +42,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 usage screen, and locate the custom report on it.
|
# Generate the usage screen, and locate the custom report on it.
|
||||||
|
@ -51,11 +50,5 @@ like ($output, qr/Unrecognized column name 'foo'\.\n/, 'custom report spotted in
|
||||||
|
|
||||||
# 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'};
|
||||||
|
@ -42,7 +42,6 @@ if (open my $fh, '>', 'pri.rc')
|
||||||
"report.foo.labels=ID,Pri\n",
|
"report.foo.labels=ID,Pri\n",
|
||||||
"report.foo.sort=id+\n";
|
"report.foo.sort=id+\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'pri.rc', 'Created pri.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Generate the usage screen, and locate the custom report on it.
|
# Generate the usage screen, and locate the custom report on it.
|
||||||
|
@ -58,11 +57,5 @@ like ($output, qr/3\s+Low/, 'priority.long Low');
|
||||||
|
|
||||||
# Cleanup.
|
# Cleanup.
|
||||||
unlink qw(pending.data completed.data undo.data backlog.data pri.rc);
|
unlink qw(pending.data completed.data undo.data backlog.data pri.rc);
|
||||||
ok (! -r 'pending.data' &&
|
|
||||||
! -r 'completed.data' &&
|
|
||||||
! -r 'undo.data' &&
|
|
||||||
! -r 'backlog.data' &&
|
|
||||||
! -r 'pri.rc', 'Cleanup');
|
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|
||||||
|
|
|
@ -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'};
|
||||||
|
@ -42,7 +42,6 @@ if (open my $fh, '>', 'custom.rc')
|
||||||
"report.foo.labels=ID,R\n",
|
"report.foo.labels=ID,R\n",
|
||||||
"report.foo.sort=id+\n";
|
"report.foo.sort=id+\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'custom.rc', 'Created custom.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Add a recurring and non-recurring task, look for the indicator.
|
# Add a recurring and non-recurring task, look for the indicator.
|
||||||
|
@ -59,11 +58,5 @@ unlike ($output, qr/2\s+RE/, 'No custom recurrence indicator t2');
|
||||||
|
|
||||||
# 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 => 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, '>', '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.
|
||||||
|
@ -57,11 +56,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 => 7;
|
use Test::More tests => 5;
|
||||||
|
|
||||||
# Ensure environment has no influence.
|
# Ensure environment has no influence.
|
||||||
delete $ENV{'TASKDATA'};
|
delete $ENV{'TASKDATA'};
|
||||||
|
@ -42,7 +42,6 @@ if (open my $fh, '>', 'custom.rc')
|
||||||
"report.foo.labels=ID,T\n",
|
"report.foo.labels=ID,T\n",
|
||||||
"report.foo.sort=id+\n";
|
"report.foo.sort=id+\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'custom.rc', 'Created custom.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Generate the usage screen, and locate the custom report on it.
|
# Generate the usage screen, and locate the custom report on it.
|
||||||
|
@ -59,11 +58,5 @@ unlike ($output, qr/2\s+TAG/, 'No custom tag indicator t2');
|
||||||
|
|
||||||
# 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;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue