- 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:
Scott Kostyshak 2013-01-01 14:45:27 -05:00 committed by Paul Beckingham
parent 21704e6705
commit 4ca5c85054
3 changed files with 16 additions and 3 deletions

View file

@ -75,6 +75,9 @@ Bugs
.taskrc file (thanks to Pietro Cerutti).
+ Fixed bug with 'socm' date calculation that failed on some days, by
simplifying the implementation.
+ Fix a bug where 'print.empty.columns=no' resulted in never printing the
project column.
------ old releases ------------------------------

View file

@ -264,6 +264,9 @@ int longestWord (const std::string& input)
length += mk_wcwidth (character);
}
if (length > longest)
longest = length;
return longest;
}

View file

@ -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' &&