From: Jason Etheridge Date: Thu, 13 Jun 2013 19:45:11 +0000 (-0400) Subject: Test for an MFHD warning in 14-OpenILS-Utils.t X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fcollab%2Fphasefx%2Ftest_cleanup;p=working%2FEvergreen.git Test for an MFHD warning in 14-OpenILS-Utils.t Specifically "Cannot compress without pattern data, returning original holdings" I also added Test::Warn to Makefile.install for Debian and Fedora. Signed-off-by: Jason Etheridge --- diff --git a/Open-ILS/src/extras/Makefile.install b/Open-ILS/src/extras/Makefile.install index c5aacd6590..c94cf4b6db 100644 --- a/Open-ILS/src/extras/Makefile.install +++ b/Open-ILS/src/extras/Makefile.install @@ -82,6 +82,7 @@ DEBS = \ libole-storage-lite-perl\ libspreadsheet-writeexcel-perl\ libssh2-1-dev\ + libtest-warn-perl\ libtext-aspell-perl\ libtext-csv-perl\ libuniversal-require-perl\ @@ -153,6 +154,7 @@ FEDORA_RPMS = \ perl-OLE-Storage_Lite \ perl-RPC-XML \ perl-Spreadsheet-WriteExcel \ + perl-Test-Warn \ perl-Text-Aspell \ perl-Text-CSV \ perl-Text-CSV_XS \ diff --git a/Open-ILS/src/perlmods/t/14-OpenILS-Utils.t b/Open-ILS/src/perlmods/t/14-OpenILS-Utils.t index 209a48b506..124fa82afb 100644 --- a/Open-ILS/src/perlmods/t/14-OpenILS-Utils.t +++ b/Open-ILS/src/perlmods/t/14-OpenILS-Utils.t @@ -1,6 +1,7 @@ #!perl -T -use Test::More tests => 29; +use Test::More tests => 30; +use Test::Warn; use_ok( 'OpenILS::Utils::Configure' ); use_ok( 'OpenILS::Utils::Cronscript' ); @@ -33,7 +34,11 @@ $co_marc->append_fields( ); my $co_mfhd = MFHD->new($co_marc); -my @comp_holdings = $co_mfhd->get_compressed_holdings($co_mfhd->field('853')); +warning_like { + my @comp_holdings = $co_mfhd->get_compressed_holdings($co_mfhd->field('853')); +} [ qr/Cannot compress without pattern data, returning original holdings/ ], + "warning when attempting to compress holdings without a pattern"; + is(@comp_holdings, 0, "Compressed holdings for an MFHD record that only has a caption"); my @decomp_holdings = $co_mfhd->get_decompressed_holdings($co_mfhd->field('853'));