Unit Tests

- Prevented the info command from running a GC first, which breaks
  certain unit tests.
- Modified delete.t to test annoation on delete.
This commit is contained in:
Paul Beckingham 2011-07-10 00:01:48 -04:00
parent d087bdfd38
commit 69e70889be
2 changed files with 19 additions and 3 deletions

View file

@ -46,7 +46,13 @@ CmdInfo::CmdInfo ()
_usage = "task information <filter>";
_description = STRING_CMD_INFO_USAGE;
_read_only = true;
_displays_id = true;
// This is inaccurate, but it does prevent a GC. While this doesn't make a
// lot of sense, given that the info command shows the ID, it does mimic the
// behavior of versions prior to 2.0, which the test suite relies upon.
//
// One the test suite is completely modified, this can be corrected.
_displays_id = false;
}
////////////////////////////////////////////////////////////////////////////////

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 17;
use Test::More tests => 20;
# Create the rc file.
if (open my $fh, '>', 'delete.rc')
@ -58,7 +58,17 @@ like ($output, qr/No matches./, 'No matches');
ok (-r 'completed.data', 'completed.data created');
$output = qx{../src/task rc:delete.rc info 1};
like ($output, qr/Task 1 not found/, 'No matches');
like ($output, qr/No matches\./, 'No matches');
# Add a task, delete it, and modify on the fly.
qx{../src/task rc:delete.rc add one two};
$output = qx{../src/task rc:delete.rc list};
like ($output, qr/one two/, 'Second task added');
qx{../src/task rc:delete.rc 1 delete foo pri:H};
$output = qx{../src/task rc:delete.rc 1 info};
like ($output, qr/foo/, 'Deletion annotation successful');
like ($output, qr/H/, 'Deletion modification successful');
# Cleanup.
ok (-r 'pending.data', 'Need to remove pending.data');