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
bdad6642c8
commit
8eef295bea
11 changed files with 11 additions and 88 deletions
|
@ -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'};
|
||||||
|
@ -40,7 +40,6 @@ if (open my $fh, '>', 'color.rc')
|
||||||
"color.active=red\n",
|
"color.active=red\n",
|
||||||
"_forcecolor=1\n";
|
"_forcecolor=1\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'color.rc', 'Created color.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Test the add command.
|
# Test the add command.
|
||||||
|
@ -54,11 +53,5 @@ like ($output, qr/ \033\[31m .* red .* \033\[0m /x, 'color.active');
|
||||||
|
|
||||||
# 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 => 4;
|
use Test::More tests => 2;
|
||||||
|
|
||||||
# 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.alternate=\n",
|
"color.alternate=\n",
|
||||||
"_forcecolor=1\n";
|
"_forcecolor=1\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'color.rc', 'Created color.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Test the add command.
|
# Test the add command.
|
||||||
|
@ -55,11 +54,5 @@ like ($output, qr/ \033\[31m .* red .* \033\[0m /x, 'color.blocked');
|
||||||
|
|
||||||
# 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'};
|
||||||
|
@ -40,7 +40,6 @@ if (open my $fh, '>', 'color.rc')
|
||||||
"color.pri.H=red\n",
|
"color.pri.H=red\n",
|
||||||
"fontunderline=no\n";
|
"fontunderline=no\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'color.rc', 'Created color.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Test the add command.
|
# Test the add command.
|
||||||
|
@ -53,11 +52,5 @@ unlike ($output, qr/\033\[0m/, 'color.disable - no color reset');
|
||||||
|
|
||||||
# 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 => 6;
|
use Test::More tests => 4;
|
||||||
|
|
||||||
# Ensure environment has no influence.
|
# Ensure environment has no influence.
|
||||||
delete $ENV{'TASKDATA'};
|
delete $ENV{'TASKDATA'};
|
||||||
|
@ -45,7 +45,6 @@ if (open my $fh, '>', 'color.rc')
|
||||||
"color.keyword.yellow=yellow\n",
|
"color.keyword.yellow=yellow\n",
|
||||||
"_forcecolor=1\n";
|
"_forcecolor=1\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'color.rc', 'Created color.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Test the add command.
|
# Test the add command.
|
||||||
|
@ -63,11 +62,5 @@ like ($output, qr/ \033\[33m .* annotation .* \033\[0m /x, 'color.ke
|
||||||
|
|
||||||
# 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 => 4;
|
use Test::More tests => 2;
|
||||||
|
|
||||||
# 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')
|
||||||
"_forcecolor=1\n",
|
"_forcecolor=1\n",
|
||||||
"dateformat=m/d/Y\n";
|
"dateformat=m/d/Y\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'color.rc', 'Created color.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Test the add command.
|
# Test the add command.
|
||||||
|
@ -54,11 +53,5 @@ like ($output, qr/ \033\[31m .* red .* \033\[0m/x, 'color.overdue');
|
||||||
|
|
||||||
# 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 => 6;
|
use Test::More tests => 4;
|
||||||
|
|
||||||
# Ensure environment has no influence.
|
# Ensure environment has no influence.
|
||||||
delete $ENV{'TASKDATA'};
|
delete $ENV{'TASKDATA'};
|
||||||
|
@ -44,7 +44,6 @@ if (open my $fh, '>', 'color.rc')
|
||||||
"color.alternate=\n",
|
"color.alternate=\n",
|
||||||
"_forcecolor=1\n";
|
"_forcecolor=1\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'color.rc', 'Created color.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Test the add command.
|
# Test the add command.
|
||||||
|
@ -61,11 +60,5 @@ like ($output, qr/ \033\[33m .* yellow .* \033\[0m /x, 'color.pri.none');
|
||||||
|
|
||||||
# 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 => 4;
|
use Test::More tests => 2;
|
||||||
|
|
||||||
# Ensure environment has no influence.
|
# Ensure environment has no influence.
|
||||||
delete $ENV{'TASKDATA'};
|
delete $ENV{'TASKDATA'};
|
||||||
|
@ -42,7 +42,6 @@ if (open my $fh, '>', 'color.rc')
|
||||||
"color.alternate=\n",
|
"color.alternate=\n",
|
||||||
"_forcecolor=1\n";
|
"_forcecolor=1\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'color.rc', 'Created color.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Test the add command.
|
# Test the add command.
|
||||||
|
@ -55,11 +54,5 @@ like ($output, qr/ \033\[31m .* red .* \033\[0m /x, 'color.project.re
|
||||||
|
|
||||||
# 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 => 4;
|
use Test::More tests => 2;
|
||||||
|
|
||||||
# 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.due=\n",
|
"color.due=\n",
|
||||||
"_forcecolor=1\n";
|
"_forcecolor=1\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'color.rc', 'Created color.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Test the add command.
|
# Test the add command.
|
||||||
|
@ -54,11 +53,5 @@ like ($output, qr/ \033\[31m .* red .* \033\[0m /x, 'color.recur
|
||||||
|
|
||||||
# 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'};
|
||||||
|
@ -44,7 +44,6 @@ if (open my $fh, '>', 'color.rc')
|
||||||
"color.tag.green=green\n",
|
"color.tag.green=green\n",
|
||||||
"_forcecolor=1\n";
|
"_forcecolor=1\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'color.rc', 'Created color.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Test the add command.
|
# Test the add command.
|
||||||
|
@ -59,11 +58,5 @@ like ($output, qr/ \033\[32m .* green .* \033\[0m /x, 'color.tag.green'
|
||||||
|
|
||||||
# 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'};
|
||||||
|
@ -44,7 +44,6 @@ if (open my $fh, '>', 'color.rc')
|
||||||
"color.alternate=\n",
|
"color.alternate=\n",
|
||||||
"_forcecolor=1\n";
|
"_forcecolor=1\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'color.rc', 'Created color.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Test the add command.
|
# Test the add command.
|
||||||
|
@ -57,11 +56,5 @@ like ($output, qr/ \033\[31m .* red .* \033\[0m /x, 'color.tagged');
|
||||||
|
|
||||||
# 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 => 4;
|
use Test::More tests => 2;
|
||||||
|
|
||||||
# Ensure environment has no influence.
|
# Ensure environment has no influence.
|
||||||
delete $ENV{'TASKDATA'};
|
delete $ENV{'TASKDATA'};
|
||||||
|
@ -43,7 +43,6 @@ if (open my $fh, '>', 'color.rc')
|
||||||
"color.alternate=\n",
|
"color.alternate=\n",
|
||||||
"_forcecolor=1\n";
|
"_forcecolor=1\n";
|
||||||
close $fh;
|
close $fh;
|
||||||
ok (-r 'color.rc', 'Created color.rc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
qx{../src/task rc:color.rc add one 2>&1};
|
qx{../src/task rc:color.rc add one 2>&1};
|
||||||
|
@ -55,11 +54,5 @@ like ($output, qr/ \033\[31m .* two .* \033\[0m /x, 'Found color.uda');
|
||||||
|
|
||||||
# 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;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue