diff --git a/ChangeLog b/ChangeLog index 4302194d6..41e2f0401 100644 --- a/ChangeLog +++ b/ChangeLog @@ -32,6 +32,7 @@ - TW-218 Reveal terms of urgency calculation for a given task (thanks to Max Muller). - TW-221 Migrate task-faq man page to the Wiki. +- TW-230 Filter tasks on partial UUIDs (thanks to Paul Kishimoto). - TW-242 extra Space when annotating a path/filename, taskopen can not open the file (thanks to Andreas Kalex). - TW-244 task add "Description (Information)" results in @@ -98,6 +99,7 @@ (thanks to Kosta Harlan). - TW-1321 Unit test view.t fails oddly on Ubuntu 13.10 (thanks to John West). - TW-1324 Numeric UDAs are compared as strings (thanks to Ben Boeckel). +- TW-1329 Short UUIDs (thanks to Benjamin Weber). - TW-1331 date more than 5 years away is faulty (thanks to Onion). - TW-1336 Project attribute does not allow whitespace (thanks to Benjamin Weber). - TW-1341 confirmation config setting should apply to config command as well diff --git a/src/Nibbler.cpp b/src/Nibbler.cpp index a1f01c675..05b9aa749 100644 --- a/src/Nibbler.cpp +++ b/src/Nibbler.cpp @@ -40,7 +40,7 @@ #include static const char* _uuid_pattern = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; -static const unsigned int _uuid_min_length = 14; +static const unsigned int _uuid_min_length = 8; //////////////////////////////////////////////////////////////////////////////// Nibbler::Nibbler () diff --git a/test/feature.891.t b/test/feature.891.t index 2f95bd04a..3f4b5aa81 100755 --- a/test/feature.891.t +++ b/test/feature.891.t @@ -157,27 +157,27 @@ like ($output, qr/one/, "Found with $short"); ($short) = $uuid =~ /^(.{13})/; $output = qx{../src/task rc:$rc $short list 2>&1}; -unlike ($output, qr/one/, "Not found with $short"); +like ($output, qr/one/, "Found with $short"); ($short) = $uuid =~ /^(.{12})/; $output = qx{../src/task rc:$rc $short list 2>&1}; -unlike ($output, qr/one/, "Not found with $short"); +like ($output, qr/one/, "Found with $short"); ($short) = $uuid =~ /^(.{11})/; $output = qx{../src/task rc:$rc $short list 2>&1}; -unlike ($output, qr/one/, "Not found with $short"); +like ($output, qr/one/, "Found with $short"); ($short) = $uuid =~ /^(.{10})/; $output = qx{../src/task rc:$rc $short list 2>&1}; -unlike ($output, qr/one/, "Not found with $short"); +like ($output, qr/one/, "Found with $short"); ($short) = $uuid =~ /^(.{9})/; $output = qx{../src/task rc:$rc $short list 2>&1}; -unlike ($output, qr/one/, "Not found with $short"); +like ($output, qr/one/, "Found with $short"); ($short) = $uuid =~ /^(.{8})/; $output = qx{../src/task rc:$rc $short list 2>&1}; -unlike ($output, qr/one/, "Not found with $short"); +like ($output, qr/one/, "Found with $short"); ($short) = $uuid =~ /^(.{7})/; $output = qx{../src/task rc:$rc $short list 2>&1}; diff --git a/test/nibbler.t.cpp b/test/nibbler.t.cpp index 642e96a24..299421811 100644 --- a/test/nibbler.t.cpp +++ b/test/nibbler.t.cpp @@ -40,16 +40,15 @@ int main (int argc, char** argv) { #ifdef NIBBLER_FEATURE_DATE #ifdef NIBBLER_FEATURE_REGEX - UnitTest t (408); + UnitTest t (417); #else - UnitTest t (384); - UnitTest t (378); + UnitTest t (387); #endif #else #ifdef NIBBLER_FEATURE_REGEX - UnitTest t (344); + UnitTest t (353); #else - UnitTest t (320); + UnitTest t (329); #endif #endif @@ -499,28 +498,34 @@ int main (int argc, char** argv) t.ok (n.depleted (), "depleted"); n = Nibbler ("a0b1c2d3-e4f5"); - t.notok (n.getPartialUUID (s), "partial uuid [13] not found"); - t.notok (n.depleted (), "depleted"); + t.ok (n.getPartialUUID (s), "partial uuid [13] found"); + t.is (s, "a0b1c2d3-e4f5", "partial uuid [13] -> correct"); + t.ok (n.depleted (), "depleted"); n = Nibbler ("a0b1c2d3-e4f"); - t.notok (n.getPartialUUID (s), "partial uuid [12] not found"); - t.notok (n.depleted (), "depleted"); + t.ok (n.getPartialUUID (s), "partial uuid [12] found"); + t.is (s, "a0b1c2d3-e4f", "partial uuid [12] -> correct"); + t.ok (n.depleted (), "depleted"); n = Nibbler ("a0b1c2d3-e4"); - t.notok (n.getPartialUUID (s), "partial uuid [11] not found"); - t.notok (n.depleted (), "depleted"); + t.ok (n.getPartialUUID (s), "partial uuid [11] found"); + t.is (s, "a0b1c2d3-e4", "partial uuid [11] -> correct"); + t.ok (n.depleted (), "depleted"); n = Nibbler ("a0b1c2d3-e"); - t.notok (n.getPartialUUID (s), "partial uuid [10] not found"); - t.notok (n.depleted (), "depleted"); + t.ok (n.getPartialUUID (s), "partial uuid [10] found"); + t.is (s, "a0b1c2d3-e", "partial uuid [10] -> correct"); + t.ok (n.depleted (), "depleted"); n = Nibbler ("a0b1c2d3-"); - t.notok (n.getPartialUUID (s), "partial uuid [9] not found"); - t.notok (n.depleted (), "depleted"); + t.ok (n.getPartialUUID (s), "partial uuid [9] found"); + t.is (s, "a0b1c2d3-", "partial uuid [9] -> correct"); + t.ok (n.depleted (), "depleted"); n = Nibbler ("a0b1c2d3"); - t.notok (n.getPartialUUID (s), "partial uuid [8] not found"); - t.notok (n.depleted (), "not depleted"); + t.ok (n.getPartialUUID (s), "partial uuid [8] found"); + t.is (s, "a0b1c2d3", "partial uuid [8] -> correct"); + t.ok (n.depleted (), "not depleted"); // bool getDateISO (time_t&); t.diag ("Nibbler::getDateISO");