Commit graph

41 commits

Author SHA1 Message Date
Paul Beckingham
6514bdfc4d TW-28, TW-271, TW-277, TW-752, TW-1265
- TW-1265 cannot add UDA with underscore (thanks to Jakub Wilk).
- Added unit tests for TW-1265.
- Added ChangeLog and AUTHOR entries for other fixed issues.
2014-05-31 11:11:53 -04:00
Paul Beckingham
98f740e9d1 Merge branch '2.3.0' into 2.4.0
Conflicts:
	AUTHORS
	CMakeLists.txt
	NEWS
	src/A3.cpp
	src/CMakeLists.txt
	src/Config.cpp
	src/Duration.cpp
	src/Duration.h
	src/Nibbler.cpp
	src/Nibbler.h
	src/RX.cpp
	src/RX.h
	src/columns/ColDate.cpp
	src/columns/ColScheduled.cpp
	src/commands/Command.cpp
	src/legacy.cpp
	src/utf8.cpp
	src/utf8.h
	test/CMakeLists.txt
	test/bug.mergedeps.t.postponed
	test/duration.t.cpp
	test/merge.duplicates.t
	test/merge.simple_duplication.t
	test/merge.t
	test/nibbler.t.cpp
	test/roundtrip.t
	test/rx.t.cpp
	test/utf8.t.cpp
2014-01-07 19:10:03 -05:00
Paul Beckingham
4cf0763845 Nibbler
- Merged libexpr changes.
2014-01-02 00:34:51 -05:00
Paul Beckingham
8ed92ca498 Copyright
- Bumped copyright to 2014, ready for release.
2014-01-01 13:32:22 -05:00
Paul Beckingham
efae57d56b Merge from libexpr
- Incorporated Nibbler changes from libexpr.
2013-12-08 16:19:38 -05:00
Paul Beckingham
ada6e49dab Bug #1251
- #1251 tests should sanitize TASKDATA and TASKRC env vars (thanks to Jakub
  Wilk).
2013-09-07 13:52:16 -04:00
Paul Beckingham
663c82837c Nibbler::backN
- Added a method to support multi-byte backstep through a string.
- Added unit tests.
2013-08-31 16:02:51 -04:00
Paul Beckingham
d03c4cda8a Build Error
- Many files were missing an explicit cmake.h include.  Some were not including
  it at all.  Now it's used almost everywhere.

(cherry picked from commit 82ae86979c497e6d1d0c6b2b5a55aa379ec82c98)
2013-06-02 13:57:36 -04:00
Paul Beckingham
a1132f0028 Code Cleanup
- Cmake was not updating HAVE_ST_BIRTHTIME.
- NIBBLER_FEATURE_DATE was not properly applied everywhere.
- FEATURE_COLOR was not properly set.
- Some source files failed to include cmake.h, and therefore were not properly
- Removed inefficient use of std::string::substr for guaranteed single character
  strings.
- Integrated Directory::cd.
- Integrated File::ctime, ::btime.
- Integrated Path::operator+.
- Integrated Nibbler::getDigit{2,4,6}.
- Integrated HighResTimer.
  enabling/disabling code.
- All Path objects now expanded internally to absolute form.
- Modified unit tests to accomodate absolute paths.
- Merged new nibbler.t.cpp tests.
- Made various methods const.
- Includes removed from some files, added to others.
2013-05-05 08:33:52 -04:00
Paul Beckingham
1dccd29643 Copyright 2013
- Updated copyright notices.
2013-03-04 17:47:12 -05:00
Scott Kostyshak
7a6cdde571 Code Cleanup
- Constify some catches.
2012-09-04 22:04:41 -04:00
Louis-Claude Canon
ec330921de Code Cleanup
- Factorize code for parsing date elements.
- Better order of blocks for parsing date elements.
- Add corresponding minimal-digit date parsing method for reading seconds,
  minutes and week.
- Update documentation and test.
2012-08-02 00:11:12 -04:00
Louis-Claude Canon
ee0a16f663 Enhancement
- Undefined variables are put to today in dates (if year and month is not
  specified, the current ones are considered). But if a global ones is
  specified, lower one are put to their default values (0 or 1).
2012-08-01 23:41:28 -04:00
Paul Beckingham
c20c025c8e Bug
- Fixed a bug that caused a commond dateformat (YDM-HN) to be misinterpreted
  as a UUID.  Solution is to increase minimum partial UUID length from 9 to
  14.
2012-07-17 18:30:58 -04:00
Paul Beckingham
9a6319a210 Parsing
- Use of broken 'isalpha' caused 'entrée' to be parsed by Nibbler::getName
  as 'entr'.  This is part of bug #1006, but only a small part.
2012-06-10 16:17:09 -04:00
Paul Beckingham
e8309fcf49 Unit Tests
- Added unit test to nibbler.t that illustrates one of the problems
  associated with bug #1006: Nibbler::getName read "entrée" and finds
  "entr".
2012-06-10 15:54:39 -04:00
Paul Beckingham
f4bfa1b2fd Bug #995
- Fixed bug #995, which mis-parsed UUIDs in filters as other elements (thanks
  to Bryce Harrington).
- Nibbler no longer permits 8-character UUID abbreviations, because too often
  they resemble other forms, such as '1111111d' which looks like a duration.
- Modified unit tests accordingly.
2012-04-29 00:28:28 -04:00
Paul Beckingham
7a45db4d0f Feature #891
- Added feature #891, which allows for leftmost partial matches of UUID values.
  Makes direct comparisons for full-length values, and regular expressions for
  partial values.  Note that there is a minimum length of 8 hex digits.
- Added safety parsing mechanism that fails a partial UUID if immediately
  followed by a hex digit.  This allows for numbers longer than 8 digits to not
  be misinterpreted as a UUID.
- Implemented Nibbler::getPartialUUID.
- Implemented unit tests.
@@ -1145,12 +1145,23 @@ const A3 A3::sequence (const A3& input) const

   for (unsigned int i = 0; i < uuids.size (); ++i)
   {
-    if (ids.size ())
+    if (ids.size () + i > 0)
       sequenced.push_back (Arg ("or", Arg::cat_op));

-    sequenced.push_back (Arg ("uuid",        Arg::type_string, Arg::cat_dom));
-    sequenced.push_back (Arg ("=",                             Arg::cat_op));
-    sequenced.push_back (Arg (uuids[i],      Arg::type_string, Arg::cat_literal));
+    // A full-length UUID requires a string comparison.
+    if (uuids[i].length () == 36)
+    {
+      sequenced.push_back (Arg ("uuid",         Arg::type_string, Arg::cat_dom));
+      sequenced.push_back (Arg ("=",                              Arg::cat_op));
+      sequenced.push_back (Arg (uuids[i],       Arg::type_string, Arg::cat_literal));
+    }
+    // A UUID fragment is a leftmost comparison.
+    else
+    {
+      sequenced.push_back (Arg ("uuid",         Arg::type_string, Arg::cat_dom));
+      sequenced.push_back (Arg ("~",                              Arg::cat_op));
+      sequenced.push_back (Arg ("^" + uuids[i], Arg::type_string, Arg::cat_rx));
+    }
   }

   sequenced.push_back (Arg (")", Arg::cat_op));
@@ -1674,11 +1685,11 @@ bool A3::is_uuid (Nibbler& n, std::string& result)
   n.save ();
   result = "";
   std::string uuid;
-  if (n.getUUID (uuid))
+  if (n.getPartialUUID (uuid))
   {
     result += uuid;
     while (n.skip (',') &&
-           n.getUUID (uuid))
+           n.getPartialUUID (uuid))
     {
       result += ',' + uuid;
     }
@@ -1997,13 +2008,13 @@ bool A3::extract_uuid (
   Nibbler n (input);

   std::string uuid;
-  if (n.getUUID (uuid))
+  if (n.getPartialUUID (uuid))
   {
     sequence.push_back (uuid);

     while (n.skip (','))
     {
-      if (!n.getUUID (uuid))
+      if (!n.getPartialUUID (uuid))
         throw std::string (STRING_A3_UUID_AFTER_COMMA);

       sequence.push_back (uuid);
2012-02-19 22:27:40 -05:00
Paul Beckingham
96fe3f42ba Minor Refactoring
- Added support for more type-specific checks of attribute values.
- Added support for more type-specific attribute rendering.
- Improved generalized methods for checking columns in a report.
- Added unit tests.
- Minor code cleanup.
- Added secret hidden feature for internal testing.
2012-02-05 20:56:46 -05:00
Paul Beckingham
89b5c91a35 Unit Tests
- Corrected method name.
2012-01-30 20:27:50 -05:00
Paul Beckingham
ec96d929a0 Bug 879 - Description/Annotation ending with Slash Causes Problems
- Backslashes actually.  The escaping mechanism in the low-level parser
  was eating leading \ characters when it should not.  Very hard bug to
  find, trivial to fix.
- Added unit tests to several components while narrowing this down.
2012-01-29 15:36:05 -05:00
Paul Beckingham
938a33f236 Unit Tests
- Typo in #ifdef caused incorrect number of reported tests.
2012-01-05 20:17:03 -05:00
Paul Beckingham
fb38dca1db Parsing
- Integrated modified Nibbler and test code from kronisk.  These
  changes make both test and Nibbler standalone objects, with configurable
  features.
2012-01-05 17:37:50 -05:00
Paul Beckingham
6580095002 Copyright
- Year change.
2012-01-02 23:32:10 -05:00
Federico Hernandez
bbe218a6f1 License
- first round of unit tests
2011-10-08 12:17:42 +02:00
Paul Beckingham
36db62728b Unit Tests
- Improved signal to noise ratio for caseless.t.
- Added test count markers to nibbler.t.cpp.
2011-09-06 23:39:57 -04:00
Paul Beckingham
47ae2ee9f6 Unit Tests
- Added unit tests for Nibbler::getNumber when the input is simply "2.0".
2011-08-10 00:25:03 -04:00
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
fde7ec107a Code Cleanup
- Removed obsolete Nibbler::getDOM.
2011-07-26 00:40:29 -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
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
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
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
57c1983e07 Code Migration
- Migrated taskd JSON parser into task, to provide encode/decode
  capability to Task::composeJSON.
- Migrated taskd utf8 code, replacing old unused code.
- Added unit tests or JSON.
- Migrated Tree updates from taskd.
2011-01-22 23:33:47 -05:00
Paul Beckingham
462caf5bd4 Copyright
- Updated copyright to 2011.
2010-12-31 22:03:05 -05:00
Federico Hernandez
17ef077e27 Moved src/tests to test (cmake preperations) 2010-12-28 21:17:23 +01:00
Renamed from src/tests/nibbler.t.cpp (Browse further)