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