- An already-completed task may now also be deleted.
- Added unit tests.
This commit is contained in:
Paul Beckingham 2011-10-23 23:49:25 -04:00
parent fce2469f41
commit e5303a2180
3 changed files with 19 additions and 16 deletions

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 14;
use Test::More tests => 16;
# Create the rc file.
if (open my $fh, '>', 'delete.rc')
@ -70,6 +70,16 @@ $output = qx{../src/task rc:delete.rc 1 info};
like ($output, qr/foo/, 'Deletion annotation successful');
like ($output, qr/H/, 'Deletion modification successful');
# Add a task, complete it, then delete it.
qx{../src/task rc:delete.rc add three};
$output = qx{../src/task rc:delete.rc 2 info};
like ($output, qr/three/, 'added and verified new task');
my ($uuid) = $output =~ /UUID\s+(\S+)/;
qx{../src/task rc:delete.rc 2 done};
qx{../src/task rc:delete.rc $uuid delete};
$output = qx{../src/task rc:delete.rc $uuid info};
like ($output, qr/Deleted/, 'task added, completed, then deleted');
# Cleanup.
unlink qw(pending.data completed.data undo.data backlog.data synch.key delete.rc);
ok (! -r 'pending.data' &&