Unit Tests

- Fixed more unit tests that were out of synch with the latest
  functionality, text messages or rendering.
This commit is contained in:
Paul Beckingham 2011-08-24 00:47:44 -04:00
parent 6f38e10cab
commit 02df3853f7
4 changed files with 5 additions and 7 deletions

View file

@ -46,7 +46,7 @@ if (open my $fh, '>', '440.rc')
qx{../src/task rc:440.rc add Foo}; qx{../src/task rc:440.rc add Foo};
qx{../src/task rc:440.rc add Foo}; qx{../src/task rc:440.rc add Foo};
qx{../src/task rc:440.rc 1 /Foo/Bar/ append Appendtext}; qx{../src/task rc:440.rc 1 append /Foo/Bar/ Appendtext};
qx{../src/task rc:440.rc 2 append Appendtext /Foo/Bar/}; qx{../src/task rc:440.rc 2 append Appendtext /Foo/Bar/};
my $output1 = qx{../src/task rc:440.rc 1 ls}; my $output1 = qx{../src/task rc:440.rc 1 ls};

View file

@ -49,7 +49,7 @@ if (open my $fh, '>', 'bug_concat.rc')
qx{../src/task rc:bug_concat.rc add This is the original text}; qx{../src/task rc:bug_concat.rc add This is the original text};
my $output = qx{../src/task rc:bug_concat.rc info 1}; my $output = qx{../src/task rc:bug_concat.rc info 1};
like ($output, qr/Description\s+This is the original text\n/, 'original correct'); like ($output, qr/Description\s+This is the original text/, 'original correct');
qx{../src/task rc:bug_concat.rc 1 modify This is the modified text}; qx{../src/task rc:bug_concat.rc 1 modify This is the modified text};
$output = qx{../src/task rc:bug_concat.rc info 1}; $output = qx{../src/task rc:bug_concat.rc info 1};

View file

@ -28,7 +28,7 @@
use strict; use strict;
use warnings; use warnings;
use Test::More tests => 12; use Test::More tests => 11;
# Create the rc file. # Create the rc file.
if (open my $fh, '>', 'pri.rc') if (open my $fh, '>', 'pri.rc')
@ -36,7 +36,7 @@ if (open my $fh, '>', 'pri.rc')
print $fh "data.location=.\n", print $fh "data.location=.\n",
"report.foo.description=DESC\n", "report.foo.description=DESC\n",
"report.foo.columns=id,priority.long\n", "report.foo.columns=id,priority.long\n",
"report.foo.labels=ID,P\n", "report.foo.labels=ID,Pri\n",
"report.foo.sort=id+\n"; "report.foo.sort=id+\n";
close $fh; close $fh;
ok (-r 'pri.rc', 'Created pri.rc'); ok (-r 'pri.rc', 'Created pri.rc');
@ -46,14 +46,12 @@ if (open my $fh, '>', 'pri.rc')
qx{../src/task rc:pri.rc add one pri:H}; qx{../src/task rc:pri.rc add one pri:H};
qx{../src/task rc:pri.rc add two pri:M}; qx{../src/task rc:pri.rc add two pri:M};
qx{../src/task rc:pri.rc add three pri:L}; qx{../src/task rc:pri.rc add three pri:L};
qx{../src/task rc:pri.rc add four pri:};
my $output = qx{../src/task rc:pri.rc foo 2>&1}; my $output = qx{../src/task rc:pri.rc foo 2>&1};
like ($output, qr/ID.+Pri/, 'priority.long indicator heading'); like ($output, qr/ID.+Pri/, 'priority.long indicator heading');
like ($output, qr/1\s+High/, 'priority.long High'); like ($output, qr/1\s+High/, 'priority.long High');
like ($output, qr/2\s+Medium/, 'priority.long Medium'); like ($output, qr/2\s+Medium/, 'priority.long Medium');
like ($output, qr/3\s+Low/, 'priority.long Low'); like ($output, qr/3\s+Low/, 'priority.long Low');
like ($output, qr/4\s*\n/, 'priority.long None');
# Cleanup. # Cleanup.
unlink 'pending.data'; unlink 'pending.data';

View file

@ -75,7 +75,7 @@ $output = qx{../src/task rc:wait.rc all status:waiting wait:tomorrow};
like ($output, qr/tomorrow/ms, 'waiting task visible when specifically queried'); like ($output, qr/tomorrow/ms, 'waiting task visible when specifically queried');
$output = qx{../src/task rc:wait.rc add Complain due:today wait:tomorrow}; $output = qx{../src/task rc:wait.rc add Complain due:today wait:tomorrow};
like ($output, qr/A 'wait' date must be before a 'due' date\./, 'error on wait after due'); like ($output, qr/Warning: You have specified a 'wait' date that is after the 'due' date\./, 'warning on wait after due');
# Cleanup. # Cleanup.
unlink 'pending.data'; unlink 'pending.data';