Bug
- Fix a bug where 'print.empty.columns=no' resulted in never printing the project column because ColProject::measure did not take into account the length of the last word of the project name. - Unit tests.
This commit is contained in:
committed by
Paul Beckingham
parent
21704e6705
commit
4ca5c85054
@@ -28,7 +28,7 @@
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 4;
|
||||
use Test::More tests => 6;
|
||||
|
||||
# Create the rc file.
|
||||
if (open my $fh, '>', 'bug.rc')
|
||||
@@ -41,13 +41,20 @@ if (open my $fh, '>', 'bug.rc')
|
||||
|
||||
# Feature: variable to control printing of empty columns
|
||||
qx{../src/task rc:bug.rc add sample desc 2>&1};
|
||||
qx{../src/task rc:bug.rc add withP project:house 2>&1};
|
||||
|
||||
my $output = qx{../src/task test rc:bug.rc 2>&1};
|
||||
my $output = qx{../src/task test sample rc:bug.rc 2>&1};
|
||||
like ($output, qr/Project/, 'empty \'project\' column is printed by default');
|
||||
|
||||
$output = qx{../src/task test rc.print.empty.columns:no rc:bug.rc 2>&1};
|
||||
$output = qx{../src/task test sample rc.print.empty.columns:no rc:bug.rc 2>&1};
|
||||
unlike ($output, qr/Project/, 'empty \'project\' column is not printed if rc.print.empty.columns:no');
|
||||
|
||||
$output = qx{../src/task test rc:bug.rc 2>&1};
|
||||
like ($output, qr/Project/, 'non-empty \'project\' column is printed by default');
|
||||
|
||||
$output = qx{../src/task test rc.print.empty.columns:no rc:bug.rc 2>&1};
|
||||
like ($output, qr/Project/, 'non-empty \'project\' column is printed if rc.print.empty.columns:no');
|
||||
|
||||
# Cleanup.
|
||||
unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc);
|
||||
ok (! -r 'pending.data' &&
|
||||
|
||||
Reference in New Issue
Block a user