mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Bug 466
- Fixed #466, which gave the wrong error message when a custom report was missing a direction indicator for the sort order. - Added unit tests.
This commit is contained in:
parent
c7cd2d2619
commit
63384abd14
3 changed files with 71 additions and 0 deletions
|
@ -730,6 +730,12 @@ void validSortColumns (
|
|||
std::vector <std::string>::const_iterator sc;
|
||||
for (sc = sortColumns.begin (); sc != sortColumns.end (); ++sc)
|
||||
{
|
||||
char direction = (*sc)[sc->length () - 1];
|
||||
if (direction != '-' && direction != '+')
|
||||
throw std::string ("Sort column '") +
|
||||
*sc +
|
||||
"' does not have a +/- ascending/descending indicator.";
|
||||
|
||||
std::vector <std::string>::const_iterator co;
|
||||
for (co = columns.begin (); co != columns.end (); ++co)
|
||||
if (sc->substr (0, sc->length () - 1) == *co)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue