Enhancement - annotations

- Added support for "annotate" command to annotate existing tasks.
- Bumped file format to version 3, due to the annotations.
- Added unit tests to verify that annotations work.
- Changed 'description' column everywhere to include annotations.
- Added 'description_only' column to exclude the annotations.
- Fixed bug in Table.cpp that calculated the width of multi-line
  columns by using the cell length, instead of the length of the
  longest individual line.
- Updated documentation with new feature.
- Updated documentation with new column.
- Enhanced t.t unit tests to cover format 43
This commit is contained in:
Paul Beckingham 2009-03-24 01:57:12 -04:00
parent ca795ea281
commit 3979c3283e
16 changed files with 446 additions and 54 deletions

View file

@ -31,11 +31,11 @@
////////////////////////////////////////////////////////////////////////////////
int main (int argc, char** argv)
{
UnitTest test (5);
UnitTest test (8);
T t;
std::string s = t.compose ();
test.is ((int)s.length (), 46, "T::T (); T::compose ()");
test.is ((int)s.length (), 49, "T::T (); T::compose ()");
test.diag (s);
t.setStatus (T::completed);
@ -54,11 +54,26 @@ int main (int argc, char** argv)
test.diag (s);
// Round trip test.
std::string sample = "00000000-0000-0000-0000-000000000000 - [] [] Sample";
std::string sample = "00000000-0000-0000-0000-000000000000 - [] [] [] Sample";
T t2;
t2.parse (sample);
sample += "\n";
test.is (t2.compose (), sample, "T::parse -> T::compose round trip");
// b10b3236-70d8-47bb-840a-b4c430758fb6 - [foo] [bar:baz] [1237865996:'woof'] sample\n
// ....:....|....:....|....:....|....:....|....:....|....:....|....:....|....:....|....:....|
// ^ ^ ^
// 0 36 66
t.setStatus (T::pending);
t.addTag ("foo");
t.setAttribute ("bar", "baz");
t.addAnnotation ("woof");
t.setDescription ("sample");
std::string format = t.compose ();
test.is (format.substr (36, 20), " - [foo] [bar:baz] [", "compose tag, attribute");
test.is (format.substr (66, 16), ":'woof'] sample\n", "compose annotation");
test.is (t.getAnnotationCount (), 1, "annotation count");
return 0;
}