Bug Fix - concatenation of colons in description
- When a task description contained a colon, the two words preceding the colon were concatenated. For example, "aa bb:cc dd" gets concatenated to "aabb:cc dd". - Added unit to test to prevent regression. - Updated documentation.
This commit is contained in:
@@ -34,6 +34,8 @@
|
|||||||
is a recurring task. This column can be added to any custom report.
|
is a recurring task. This column can be added to any custom report.
|
||||||
+ Added new column 'tag_indicator' that displays a '+' if the task
|
+ Added new column 'tag_indicator' that displays a '+' if the task
|
||||||
has any tags. This column can be added to any custom report.
|
has any tags. This column can be added to any custom report.
|
||||||
|
+ Fixed bug where sometimes a task description was concatenated oddly if
|
||||||
|
there was a colon somewhere in the description.
|
||||||
|
|
||||||
------ old releases ------------------------------
|
------ old releases ------------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -139,6 +139,8 @@
|
|||||||
is a recurring task. This column can be added to any custom report.
|
is a recurring task. This column can be added to any custom report.
|
||||||
<li>Added new column 'tag_indicator' that displays a '+' if the task
|
<li>Added new column 'tag_indicator' that displays a '+' if the task
|
||||||
has any tags. This column can be added to any custom report.
|
has any tags. This column can be added to any custom report.
|
||||||
|
<li>Fixed bug where sometimes a task description was concatenated oddly if
|
||||||
|
there was a colon somewhere in the description.
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
@@ -443,7 +443,11 @@ void parse (
|
|||||||
// If it is not a valid attribute, then allow the argument as part of
|
// If it is not a valid attribute, then allow the argument as part of
|
||||||
// the description.
|
// the description.
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if (descCandidate.length ())
|
||||||
|
descCandidate += " ";
|
||||||
descCandidate += arg;
|
descCandidate += arg;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Substitution of description text.
|
// Substitution of description text.
|
||||||
@@ -462,7 +466,7 @@ void parse (
|
|||||||
{
|
{
|
||||||
if (descCandidate.length ())
|
if (descCandidate.length ())
|
||||||
descCandidate += " ";
|
descCandidate += " ";
|
||||||
descCandidate += std::string (arg);
|
descCandidate += arg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -471,7 +475,7 @@ void parse (
|
|||||||
{
|
{
|
||||||
if (descCandidate.length ())
|
if (descCandidate.length ())
|
||||||
descCandidate += " ";
|
descCandidate += " ";
|
||||||
descCandidate += std::string (arg);
|
descCandidate += arg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 5;
|
use Test::More tests => 6;
|
||||||
|
|
||||||
# Create the rc file.
|
# Create the rc file.
|
||||||
if (open my $fh, '>', 'bug_concat.rc')
|
if (open my $fh, '>', 'bug_concat.rc')
|
||||||
@@ -47,7 +47,6 @@ if (open my $fh, '>', 'bug_concat.rc')
|
|||||||
# Thisisanewdescription
|
# Thisisanewdescription
|
||||||
|
|
||||||
qx{../task rc:bug_concat.rc add This is the original text};
|
qx{../task rc:bug_concat.rc add This is the original text};
|
||||||
|
|
||||||
my $output = qx{../task rc:bug_concat.rc info 1};
|
my $output = qx{../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\n/, 'original correct');
|
||||||
|
|
||||||
@@ -55,6 +54,18 @@ qx{../task rc:bug_concat.rc 1 This is the modified text};
|
|||||||
$output = qx{../task rc:bug_concat.rc info 1};
|
$output = qx{../task rc:bug_concat.rc info 1};
|
||||||
like ($output, qr/Description\s+This is the modified text\n/, 'modified correct');
|
like ($output, qr/Description\s+This is the modified text\n/, 'modified correct');
|
||||||
|
|
||||||
|
# When a task is added like this:
|
||||||
|
#
|
||||||
|
# % task add aaa bbb:ccc ddd
|
||||||
|
#
|
||||||
|
# The description is concatenated thus:
|
||||||
|
#
|
||||||
|
# aaabbb:ccc ddd
|
||||||
|
|
||||||
|
qx{../task rc:bug_concat.rc add aaa bbb:ccc ddd};
|
||||||
|
$output = qx{../task rc:bug_concat.rc info 2};
|
||||||
|
like ($output, qr/Description\s+aaa bbb:ccc ddd\n/, 'properly concatenated');
|
||||||
|
|
||||||
# Cleanup.
|
# Cleanup.
|
||||||
unlink 'pending.data';
|
unlink 'pending.data';
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
ok (!-r 'pending.data', 'Removed pending.data');
|
||||||
|
|||||||
Reference in New Issue
Block a user