mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-26 15:47:19 +02:00
Bug Fix - #382 task annotate doesn't complain when a task id is omitted
- added error msg when annotating without a task id
This commit is contained in:
parent
cb1b1510a9
commit
a5d8ef524e
3 changed files with 10 additions and 5 deletions
|
@ -1,11 +1,9 @@
|
||||||
|
|
||||||
------ current release ---------------------------
|
------ current release ---------------------------
|
||||||
2.0.0 ()
|
|
||||||
+ The 'config' command now highlights problems in color.
|
|
||||||
|
|
||||||
------ old releases ------------------------------
|
|
||||||
|
|
||||||
1.9.1 ()
|
1.9.1 ()
|
||||||
|
+ Fixed bugg #382 in which the annotate command didn't returned an
|
||||||
|
error message if called without an ID.
|
||||||
|
|
||||||
------ old releases ------------------------------
|
------ old releases ------------------------------
|
||||||
|
|
||||||
|
|
|
@ -1887,6 +1887,9 @@ int handleAnnotate (std::string &outs)
|
||||||
if (!context.task.has ("description"))
|
if (!context.task.has ("description"))
|
||||||
throw std::string ("Cannot apply a blank annotation.");
|
throw std::string ("Cannot apply a blank annotation.");
|
||||||
|
|
||||||
|
if (!context.task.has ("id"))
|
||||||
|
throw std::string ("ID needed to apply an annotation.");
|
||||||
|
|
||||||
std::stringstream out;
|
std::stringstream out;
|
||||||
|
|
||||||
std::vector <Task> tasks;
|
std::vector <Task> tasks;
|
||||||
|
|
|
@ -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_annotate.rc')
|
if (open my $fh, '>', 'bug_annotate.rc')
|
||||||
|
@ -43,6 +43,10 @@ qx{../task rc:bug_annotate.rc add foo};
|
||||||
my $output = qx{../task rc:bug_annotate.rc 1 annotate};
|
my $output = qx{../task rc:bug_annotate.rc 1 annotate};
|
||||||
like ($output, qr/Cannot apply a blank annotation./, 'failed on blank annotation');
|
like ($output, qr/Cannot apply a blank annotation./, 'failed on blank annotation');
|
||||||
|
|
||||||
|
# Attempt an annotation without ID
|
||||||
|
$output = qx{../task rc:bug_annotate.rc annotate bar};
|
||||||
|
like ($output, qr/ID needed to apply an annotation./, 'failed on annotation without ID');
|
||||||
|
|
||||||
# Cleanup.
|
# Cleanup.
|
||||||
unlink 'pending.data';
|
unlink 'pending.data';
|
||||||
ok (!-r 'pending.data', 'Removed pending.data');
|
ok (!-r 'pending.data', 'Removed pending.data');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue