- Fixed Bug #1060 where an error that was thrown by undo was not
  correctly caught and reported.
- Added a couple of tests to ensure that the correct error was
  caught and reported.
This commit is contained in:
Scott Kostyshak 2012-08-10 23:49:42 -04:00 committed by Paul Beckingham
parent bd085a820d
commit d73766484d
2 changed files with 7 additions and 3 deletions

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 9;
use Test::More tests => 11;
# Create the rc file.
if (open my $fh, '>', 'undo.rc')
@ -56,6 +56,11 @@ like ($output, qr/Status\s+Pending\n/, 'Pending');
$output = qx{../src/task rc:undo.rc 1 do 2>&1; ../src/task rc:undo.rc list 2>&1 >/dev/null};
like ($output, qr/No matches/, 'No matches');
# Bug 1060: Test that if undo is given an argument it catches and reports the correct error.
$output = qx{../src/task rc:undo.rc undo 1 2>&1};
unlike ($output, qr/Unknown error/, 'No unknown error');
like ($output, qr/The undo command does not allow further task modification/, 'Correct error caught and reported');
# Cleanup.
unlink qw(pending.data completed.data undo.data backlog.data synch.key undo.rc);
ok (! -r 'pending.data' &&
@ -66,4 +71,3 @@ ok (! -r 'pending.data' &&
! -r 'undo.rc', 'Cleanup');
exit 0;