mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
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:
parent
21704e6705
commit
4ca5c85054
3 changed files with 16 additions and 3 deletions
|
@ -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 ------------------------------
|
||||
|
||||
|
|
|
@ -264,6 +264,9 @@ int longestWord (const std::string& input)
|
|||
length += mk_wcwidth (character);
|
||||
}
|
||||
|
||||
if (length > longest)
|
||||
longest = length;
|
||||
|
||||
return longest;
|
||||
}
|
||||
|
||||
|
|
|
@ -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' &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue