Tie in new MFHD method to serials module/MFHD tests for compressing, combining [This commit has been squashed for merging. LFW] * Now that we have a potentially better alternative, let's call get_combined_holdings() in place of get_compressed_holdings() in Serial.pm. * First, add a test for the new get_combined_holdings() method. Second, add a known problem case for get_compressed_holdings(). The fix will come in a subsequent commit. Signed-off-by: Dan Wells <dbw2@calvin.edu> Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Fix broken builds due to test that can't find its data LP 817699 reports a problem that began with commit e9cd992fa4dbf1013346336193cb7469ecee10a8, reintroducing a problem that had previously been resolved with commit f017d1261c369b9b5cc3c9cfc4f50d3cdf12a445. In short, tests can and are run from different directories, but a new test opened a file without making any allowance that the test might be run from anything other than the /test/ directory. This fix uses the dirname(__FILE__) approach to provide the appropriate relative directory for the test data, and enables the tests to be processed without dying. Signed-off-by: Dan Scott <dscott@laurentian.ca> Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
MFHD compressed holding fixes 1. Add new utility method to MFHD.pm: holdings_by_caption(): return all holdings attached to a given caption 2. Add 'passthru_open_ended' option to get_decompressed_holdings() Previously, attempts to decompress an open-ended holding would error out. Now, in the absence of this option, open-ended holdings are discarded and you get a warning (since they cannot logically be decompressed), while if this option is 'true' they are passed back unaffected 3. compressed_to_last() on an open-ended holding now more correctly returns 'undef' rather than the unaltered holding 4. get_compressed_holdings() will now honor an open-ended holding by treating it as "infinite", and thus absorbing any holdings which would follow 5. Overloaded comparison operator now correctly detects "swap" cases (where only the second operand is a holding) 6. Overloaded comparison operator now consistently treats open-ended holdings as "greater-than" a single or closed holding which has the same starting point 7. Fix 2 thinkos in comparison operator for overlapping compressed holdings 8. Add new compressed_end() method to Holding.pm which can add or set a new ending to a holding, making compressed if needed 9. Correctly recognize partially compressed holdings If a holding is defined as: 863 40 $81.1 $a1 $b2-10 this actually means: 863 40 $81.1 $a1-1 $b2-10 so let's make sure to treat it that way. 9. Expand the MFHD test suite to better cover the improvements in this commit There is also the beginnings of a _get_truncated_holdings() method for handling odd cases where an open-ended holding is followed by a single/closed holding, but it is currently commented out, pending further design consideration. Signed-off-by: Dan Wells <dbw2@calvin.edu>
A bevy of MFHD bug fixes (and test cases) 1) Remove hard-coded 'gap' text from format_part() 2) Honor $ypm## for chron_to_date() for annuals 3) Removed overly simple check on $w as digit 4) Allow for combined chronologies other than 2nd level 5) Make calendar changes trump $u counts 6) Honor issue restarts at calendar changes 7) Rudimentary support of $u counts for non-restarting issue numbering 8) Special interpretation of $yps for early winters (i.e. winter is the first season of the calendar year) 9) Teach chron_to_date() about early winters The last two points deserve some special attention. A large number of journals consider 'Winter' to be the first season of the year, so Winter 2011 means (roughly) January 2011, not December 2011. However, there is no explicit way to indicate this in the standard, and also the code relies in many ways on the fact that 24 (chronology code for winter) is greater than 21 (code for spring). To work around this, we are interpreting a certain ambiguous pattern in a particular way. Specifically, if you set $w to a digit, then set $y to 'ps24,21,22,23' (or some variation with '24' as the first value), you will get this winter-first behavior. Also, the season is treated internally as '20' then converted to '24' when processing is completed. git-svn-id: svn://svn.open-ils.org/ILS/trunk@20470 dcc99617-32d9-48b4-a31d-7c20da2025e4
Enable MFHD tests to find their testdata When the MFHD tests wrapped in mfhd.t are invoked from outside of the directory, they tests failed to find the mfhddata.txt file. Judicious use of the __FILE__ special literal and File::Basename::dirname() avoids that problem. Now we just need to munge @INC to ensure that testlib.pm can be resolved (and hope that no conflicts ever turn up). git-svn-id: svn://svn.open-ils.org/ILS/trunk@19442 dcc99617-32d9-48b4-a31d-7c20da2025e4
Make Evergreen Perl modules installable via Module::Build to match OpenSRF Build.PL gives us an install-time check on dependencies; right now the required versions are not set, but we can update these easily to start catching some of the problematic modules that have tripped sites up in the past. Build.PL really seems to want a top-level "OpenILS.pm" so add a placeholder accordingly. Adjust references to /src/perlmods/ to /src/perlmods/lib/ even though a number of the affected scripts are probably cruft. Use autoconf to provide the default paths in O:WWW:Web and O:WWW:Method; next step is probably to teach autoconf to ask Build.PL to do that for us to make the OpenILS Perl modules more independent. git-svn-id: svn://svn.open-ils.org/ILS/trunk@19340 dcc99617-32d9-48b4-a31d-7c20da2025e4