Commit graph

1210 commits

Author SHA1 Message Date
Paul Beckingham
c244132476 Unit Tests
- Fixed bug in Nibbler::getN.
- Added unit test for Nibbler::getN.
2011-07-31 11:14:56 -04:00
Paul Beckingham
01d3da90ae Unit Tests
- Filters must precede write-commands on the command line.
2011-07-31 09:49:23 -04:00
Paul Beckingham
0ee1f9c1c6 Bug #807
- Fixed bug #807, which caused a lack of Lua to prevent tests from building
  (thanks to Owen Clarke).
2011-07-26 21:26:21 -04:00
Paul Beckingham
fde7ec107a Code Cleanup
- Removed obsolete Nibbler::getDOM.
2011-07-26 00:40:29 -04:00
Paul Beckingham
9bf1ec2f7c Code Cleanup
- Eliminated Lexer.
2011-07-26 00:37:49 -04:00
Paul Beckingham
3fd83ca400 Nibbler
- Implemented Nibbler::getName to parse an alpha-numeric name.
- Added appropriate unit tests.
2011-07-24 01:00:24 -04:00
Paul Beckingham
09d94a0712 Expressions
- Eliminated the . prefix for DOM references to the current task - it is
  unnatural to state ".due < today".
- Prioritized parsing dates ahead of integers, which were masking all
  dates.
2011-07-19 00:25:26 -04:00
Paul Beckingham
ab6e230f10 Expressions
- Implemented Nibbler::getWord.
- Re-implemented Nibbler::getDOM.
- Modified DOM addressed for context-based attributes from "due" to ".due",
  the help disambiguate DOM references in expressions.  There is now a
  consistency:

      <id>.due         Task-specific
          .due         Contextual
    <uuid>.due         General

- Implemented associated unit tests.
2011-07-18 23:08:05 -04:00
Paul Beckingham
d66729adf3 Code Cleanup
- Assorted minor edits.
- Snapshot before E9 work.
2011-07-16 23:58:03 -04:00
Paul Beckingham
7fbe124fe0 Unit Tests
- Added proper handling for when no command or filter is specified, and
  no rc.default.command exists.
- Improved wording on above error message.
- Fixed typo in previous commit (managed to check in code before the
  build completed, and ultimately failed).
- Now reports errors that occur during initialization at the same level
  of verbosity as during command execution.
2011-07-16 15:33:09 -04:00
Paul Beckingham
8aeef40b80 Unit Tests
- variant.t.cpp was reporting 6 tests but performing none.  That
  certainly doesn't help our pass rate.
2011-07-16 14:22:42 -04:00
Paul Beckingham
3a5370ddf1 Filters
- Implemented Command::filter_shortcut to detect when a filter begins
  with "status:pending" and skip the loading/parsing of completed.data.
- Removed obsolete att.t.cpp tests.
- Removed diagnostics from TDB2::TDB2 that were causing a segfault.
  I suppose there is no std::cout available during global ctors?
2011-07-14 00:46:01 -04:00
Paul Beckingham
8827f9c978 TDB2
- Implemented CmdAdd.cpp and CmdLog.cpp using TDB2.
- Implemented simple append writes in TDB2.
- Modified CmdImport to accept and parse JSON.
- Added more const-ness in DOM, Expression and Task, to allow TDB2::get_tasks
  to return a const vector ref, which is a Very Good Thing.
- Corrected usage for the export command.
- Implemented Task::urgency as a call to Task::urgency_c, which is a const
  overload to allow urgency calculations (without caching) for const Task
  objects.
- Removed obolete code from TDB.
- Added lots of diagnostic output for TDB2 - it's annoying, but will be
  gone soon.
- Added mention in CmdHelp of the new <filter> and <modifications>
  syntax elements.  Needs more.
- Added Command::filter overload which uses TDB2.  Not in use yet.
2011-07-13 23:53:57 -04:00
Paul Beckingham
2bf4276bda Unit Tests
- Renamed bug.485.x to bug.485.t to reflect that it is not only
  fixed, but relevant.
2011-07-11 01:55:56 -04:00
Paul Beckingham
21ad7a3d3f Unit Tests - add.t
- Corrected typo in unit test results.
2011-07-11 00:26:28 -04:00
Paul Beckingham
8e0296468e Unit Tests
- Improved args.5.t, which was attempting to stop tasks that were
  not started.
2011-07-10 18:04:49 -04:00
Paul Beckingham
f0d2af2651 Filter Bugs
- A substitution arg is categorized as "subst", but was tested for
  "substitution".
- The Arguments::is_multipart method was triggering on '/', which is
  wrong, but I can't remember why I put it in there.  Hmmm.
- When extracting a write-filter, substitutions after the command
  were generating an error, whereas they should be ignored.
- Task::substitute was modifying data even when the patterns were not
  matching.  Yikes.
- Added unit tests for en-passant modification of all types during
  done, delete, start, stop.
2011-07-10 01:03:52 -04:00
Paul Beckingham
69e70889be Unit Tests
- Prevented the info command from running a GC first, which breaks
  certain unit tests.
- Modified delete.t to test annoation on delete.
2011-07-10 00:01:48 -04:00
Paul Beckingham
f483d1ed9d Unit Tests - arguments.t
- Removed two obsolete expression operators, % and ^.
2011-07-09 17:49:41 -04:00
Paul Beckingham
322824567f Unit Tests - args.1.t
- Added tests to verify that '<id> <command>' and '<command> <id>'
  both work as expected.
2011-07-09 17:48:14 -04:00
Paul Beckingham
8ff3a1675d Duration
- Implemented operator+=, operator-=.
- Added unit tests.
2011-07-04 14:22:33 -04:00
Paul Beckingham
fc793e7b1d Duration
- Implemented missing operator<=, operator>=.
- Added corresponding unit tests.
2011-07-04 13:34:20 -04:00
Paul Beckingham
e1aea08f81 Unit Tests
- Fixed test that assumed old-style command usage.
- Corrected duration unit tests.
2011-07-02 10:09:37 -04:00
Paul Beckingham
fd484ee264 Feature
- The duration 'm' is now interpreted as 'months', not 'minutes'.
2011-06-30 18:35:54 -04:00
Paul Beckingham
2c621eaadc Unit Tests
- The dom.t tests were segfaulting because they used a blank Context
  with no arguments, and when the DOM referecne 'context.program' was
  queried, it failed because there was no Context::args[0].
2011-06-27 23:26:51 -04:00
Paul Beckingham
45a757832a Feature #559
- Added feature #559, which implements a new configuration variable,
  rc.exit.on.missing.db, which causes taskwarrior to exit if the
  rc.data.location is missing (thanks to Sander Marechal).
2011-06-27 23:23:28 -04:00
Paul Beckingham
42ead6b34d Report Filters
- Report filters are now properly loaded and injected into the argument
  list.
2011-06-25 21:56:57 -04:00
Paul Beckingham
a7d6b91ad3 Cleanup
- Renamed RegX to RX.  Got sick of the RegX name - looked too much like GenX.
2011-06-21 18:15:58 -04:00
Paul Beckingham
b49523c06d Regex
- Implemented RegX class to maintain a separate compile, and match
  method, thereby allowing efficient re-use of the regex.  This is
  critical to Expression::eval, where an identical regex might be
  applied to every task.
- Obsoleted rx.{h,cpp}, which combined the compile and match steps
  into a single call, and is therefore not efficient when used in
  the context of filtering.
- Fixed some unit tests that weren't building.  Now they do.  They
  don't work of course (don't be silly) but that's a problem for
  another day.
- Modified all code that relies on rx.h to use RegX.h.
2011-06-21 01:43:57 -04:00
Paul Beckingham
d6670ba198 Expressions
- Reordered operator table so that longer operators match first, thus
  disambiguating between ! and !=.
- Eliminated Expression::expand_expression.
- Modified Nibbler to know what a DOM reference looks like.
- Removed alpha equivalent operators (lt, le, gt, ge, not, eq, ne) because
  these are common in descriptions (French: le, ne).
- Modified Arguments and Nibbler unit tests.
2011-06-13 00:45:06 -04:00
Paul Beckingham
a749f83da3 Parsing
- Nibbler learned how to parse formtted dates.  Date now uses Nibbler.
- Added Nibbler unit tests.
2011-06-12 13:59:25 -04:00
Paul Beckingham
c8d9a2a268 Expressions
- Support and documentation for rc.patterns, which enables/disables
  support for /pattern/ command line arguments.
- Support and documentation for rc.expressions, which enables/disables
  support for command line expressions.
- Now canonicalizes attribute names.
- Now canonicalizes modifier names.
- New colorization (temporary) that colors all Arguments::dump output
  green when processed.
- New distinction between 'old' and 'new' style command lines.  Old style
  is "pro:A +foo pri.not:M" with implicit "and" operators.  New style
  includes operators but does not include "+foo" and "/foo/".
- Many tokens are converted directly to primitive types (int, number,
  string) when no further processing is required.
- Restored CmdShow to functionality, and linearized the list of supported
  configuration variables, for easier insertion.
- Modified arguments.t.cpp unit tests.
2011-06-12 09:17:50 -04:00
Paul Beckingham
62d2dd316b Build
- Fixed broken build on CentOS.
2011-06-11 15:32:33 -04:00
Paul Beckingham
8f20efc739 Parsing
- Nibbler now understands parsing from a list of tokens, with getOneOf.
2011-06-11 11:13:56 -04:00
Paul Beckingham
a5feb6ef83 Parsing
- Implemented Nibbler::getDigit to retrieve a single numeric digit.
- Implemented Nibbler::getISODate.
2011-06-11 08:12:05 -04:00
Paul Beckingham
f8d9338102 Expressions
- Added list of non-word characters to assist is_attr.
2011-06-10 00:17:52 -04:00
Paul Beckingham
2ab24fa08b Expressions
- Fixed some compiler warnings.
- Added DOM detection of primitives: int, double, string.
- Began implementation of DOM task access.
- Implemented support for .startswith, .endswith, .word and .noword.
- Removed obsolete subst.t.cpp.
2011-06-09 22:19:10 -04:00
Paul Beckingham
199bb85d88 Expressions
- Improved strictness of attr and attmod detection, although it needs
  more.
- Added unit tests arguments.t.cpp, to test the detection methods.
2011-06-08 00:16:19 -04:00
Paul Beckingham
d83b2d5e36 Expressions
- Implemented an operator lookup table with type, associativity and
  precedence.
- Implemented Expression::to_postfix that generates a postfix
  expression list using a Dijkstra Shunt.
2011-06-07 00:25:21 -04:00
Paul Beckingham
ed8454c202 Expressions
- Implemented sequence --> infix converter.
- Added new Lexer code.
- Added Lexer unit tests.
2011-06-06 01:46:11 -04:00
Paul Beckingham
19aa78a922 Argument Parsing
- Fixed bug in Nibbler::getUUID.
- Implemented Arguments::is_id.
- Implemented Arguments::is_uuid.
- Implemented Arguments::is_tag.
- Implemented Arguments::extract_id.
- Implemented Arguments::extract_uuid.
- Implemented Arguments::extract_tag.
- Implemented Arguments::valid_modifier.
- Implemented nibbler.t.cpp unit tests.
2011-06-04 17:02:19 -04:00
Paul Beckingham
354d66a5ac Parsing
- Implemented Nibbler::getUUID to assist parsing efforts.
2011-06-04 16:15:44 -04:00
Paul Beckingham
56ccd16730 Helpers
- Implemented longestLine, which finds the longest line in a string.
2011-05-30 21:22:26 -04:00
Paul Beckingham
306f10b420 Command Line Parsing
- Implemented Arguments::extract_command to locate the command
  keyword in an argument list.
- Implemented Arguments::extract_sequence to locate and remove an ID
  sequence from an argument list.
- Added unit test for extract_sequence.
- Stubbed all Argument::extract_<object> methods.
- Simplified code in (soon to be obsolete) Sequence.cpp.
2011-05-28 12:09:25 -04:00
Paul Beckingham
8f85b0e194 Utils - combine
- Implemented combine, which takes two integer vectors and combines
  them resulting in a single vector contianing the unique values of
  both.
2011-05-28 09:49:22 -04:00
Paul Beckingham
8fabffe18c Code Cleanup
- Eliminated '#include "x"' by changing all to '#include <x>'.
2011-05-28 00:19:59 -04:00
Paul Beckingham
32e7af4610 i18n
- Added several overloaded positional string formatters.  May need
  more.
2011-05-26 21:56:23 -04:00
Paul Beckingham
02065c3cdc i18n
- Localized a few strings, for fun.
2011-05-25 01:13:19 -04:00
Paul Beckingham
f1635c3eff Code Cleanup
- Removed obsolete Rectangle code.
2011-05-23 23:24:43 -04:00
Paul Beckingham
3f58e5a2ee Code Cleanup
- Removed unused Tree code.
2011-05-23 22:29:24 -04:00