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
@@ -75,6 +75,9 @@ Bugs
|
|||||||
.taskrc file (thanks to Pietro Cerutti).
|
.taskrc file (thanks to Pietro Cerutti).
|
||||||
+ Fixed bug with 'socm' date calculation that failed on some days, by
|
+ Fixed bug with 'socm' date calculation that failed on some days, by
|
||||||
simplifying the implementation.
|
simplifying the implementation.
|
||||||
|
+ Fix a bug where 'print.empty.columns=no' resulted in never printing the
|
||||||
|
project column.
|
||||||
|
|
||||||
|
|
||||||
------ old releases ------------------------------
|
------ old releases ------------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -264,6 +264,9 @@ int longestWord (const std::string& input)
|
|||||||
length += mk_wcwidth (character);
|
length += mk_wcwidth (character);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (length > longest)
|
||||||
|
longest = length;
|
||||||
|
|
||||||
return longest;
|
return longest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 4;
|
use Test::More tests => 6;
|
||||||
|
|
||||||
# Create the rc file.
|
# Create the rc file.
|
||||||
if (open my $fh, '>', 'bug.rc')
|
if (open my $fh, '>', 'bug.rc')
|
||||||
@@ -41,13 +41,20 @@ if (open my $fh, '>', 'bug.rc')
|
|||||||
|
|
||||||
# Feature: variable to control printing of empty columns
|
# 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 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');
|
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');
|
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.
|
# Cleanup.
|
||||||
unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc);
|
unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc);
|
||||||
ok (! -r 'pending.data' &&
|
ok (! -r 'pending.data' &&
|
||||||
|
|||||||
Reference in New Issue
Block a user