mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Unit Tests
- Improved the signal to noise ration for more unit tests.
This commit is contained in:
parent
1691ce2764
commit
2b7c2f6a21
2 changed files with 17 additions and 36 deletions
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 13;
|
use Test::More tests => 8;
|
||||||
|
|
||||||
# Create the rc file.
|
# Create the rc file.
|
||||||
if (open my $fh, '>', 'projects.rc')
|
if (open my $fh, '>', 'projects.rc')
|
||||||
|
@ -43,6 +43,7 @@ if (open my $fh, '>', 'projects.rc')
|
||||||
qx{../src/task rc:projects.rc add project:p1 one};
|
qx{../src/task rc:projects.rc add project:p1 one};
|
||||||
qx{../src/task rc:projects.rc add project:p2 two};
|
qx{../src/task rc:projects.rc add project:p2 two};
|
||||||
qx{../src/task rc:projects.rc 1 done};
|
qx{../src/task rc:projects.rc 1 done};
|
||||||
|
|
||||||
my $output = qx{../src/task rc:projects.rc ls};
|
my $output = qx{../src/task rc:projects.rc ls};
|
||||||
unlike ($output, qr/p1/, 'p1 done');
|
unlike ($output, qr/p1/, 'p1 done');
|
||||||
like ($output, qr/p2/, 'p2 pending');
|
like ($output, qr/p2/, 'p2 pending');
|
||||||
|
@ -56,23 +57,13 @@ like ($output, qr/p1/, 'p1 listed');
|
||||||
like ($output, qr/p2/, 'p2 listed');
|
like ($output, qr/p2/, 'p2 listed');
|
||||||
|
|
||||||
# Cleanup.
|
# Cleanup.
|
||||||
unlink 'pending.data';
|
unlink qw(pending.data completed.data undo.data backlog.data synch.key projects.rc);
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
ok (! -r 'pending.data' &&
|
||||||
|
! -r 'completed.data' &&
|
||||||
unlink 'completed.data';
|
! -r 'undo.data' &&
|
||||||
ok (!-r 'completed.data', 'Removed completed.data');
|
! -r 'backlog.data' &&
|
||||||
|
! -r 'synch_key.data' &&
|
||||||
unlink 'undo.data';
|
! -r 'projects.rc', 'Cleanup');
|
||||||
ok (!-r 'undo.data', 'Removed undo.data');
|
|
||||||
|
|
||||||
unlink 'backlog.data';
|
|
||||||
ok (!-r 'backlog.data', 'Removed backlog.data');
|
|
||||||
|
|
||||||
unlink 'synch.key';
|
|
||||||
ok (!-r 'synch.key', 'Removed synch.key');
|
|
||||||
|
|
||||||
unlink 'projects.rc';
|
|
||||||
ok (!-r 'projects.rc', 'Removed projects.rc');
|
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 13;
|
use Test::More tests => 8;
|
||||||
|
|
||||||
# Create the rc file.
|
# Create the rc file.
|
||||||
if (open my $fh, '>', 'tags.rc')
|
if (open my $fh, '>', 'tags.rc')
|
||||||
|
@ -57,23 +57,13 @@ like ($output, qr/t1/, 't1 listed');
|
||||||
like ($output, qr/t2/, 't2 listed');
|
like ($output, qr/t2/, 't2 listed');
|
||||||
|
|
||||||
# Cleanup.
|
# Cleanup.
|
||||||
unlink 'pending.data';
|
unlink qw(pending.data completed.data undo.data backlog.data synch.key tags.rc);
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
ok (! -r 'pending.data' &&
|
||||||
|
! -r 'completed.data' &&
|
||||||
unlink 'completed.data';
|
! -r 'undo.data' &&
|
||||||
ok (!-r 'completed.data', 'Removed completed.data');
|
! -r 'backlog.data' &&
|
||||||
|
! -r 'synch_key.data' &&
|
||||||
unlink 'undo.data';
|
! -r 'tags.rc', 'Cleanup');
|
||||||
ok (!-r 'undo.data', 'Removed undo.data');
|
|
||||||
|
|
||||||
unlink 'backlog.data';
|
|
||||||
ok (!-r 'backlog.data', 'Removed backlog.data');
|
|
||||||
|
|
||||||
unlink 'synch.key';
|
|
||||||
ok (!-r 'synch.key', 'Removed synch.key');
|
|
||||||
|
|
||||||
unlink 'tags.rc';
|
|
||||||
ok (!-r 'tags.rc', 'Removed tags.rc');
|
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue