Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package perl-Business-ISBN-Data for 
openSUSE:Factory checked in at 2021-02-17 18:09:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Business-ISBN-Data (Old)
 and      /work/SRC/openSUSE:Factory/.perl-Business-ISBN-Data.new.28504 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-Business-ISBN-Data"

Wed Feb 17 18:09:56 2021 rev:23 rq:873052 version:20210112.006

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/perl-Business-ISBN-Data/perl-Business-ISBN-Data.changes
  2021-01-22 21:49:54.493643510 +0100
+++ 
/work/SRC/openSUSE:Factory/.perl-Business-ISBN-Data.new.28504/perl-Business-ISBN-Data.changes
       2021-02-17 18:09:58.993864186 +0100
@@ -1,0 +2,56 @@
+Wed Feb 17 03:06:11 UTC 2021 - Tina M??ller <[email protected]>
+
+- updated to 20210112.006
+   see /usr/share/doc/packages/perl-Business-ISBN-Data/Changes
+
+  20210112.006 2021-02-16T04:08:08Z
+       * Fix testing bug. This module needs Business::ISBN 3.005 to match
+       the data structures. Prior to that, Business::ISBN had a bug with
+       ISBN13.
+  20210112.005_03 2021-02-15T17:43:08Z
+       * I think the CPAN Tester failures are using older versions of
+       Business::ISBN (older than 3.005 all seem to fail). I assumed they
+       started fresh, but I guess not. Require a recent version in the
+       default_data test.
+  20210112.005_02 2021-02-14T05:07:05Z
+       * Try harder to see what's going on in CPAN Testers
+  20210112.005_01 2021-02-13T12:40:28Z
+       * Try harder to figure out these test failures
+
+-------------------------------------------------------------------
+Sun Feb 14 03:06:10 UTC 2021 - Tina M??ller <[email protected]>
+
+- updated to 20210112.005
+   see /usr/share/doc/packages/perl-Business-ISBN-Data/Changes
+
+-------------------------------------------------------------------
+Thu Feb 11 03:06:09 UTC 2021 - Tina M??ller <[email protected]>
+
+- updated to 20210112.004
+   see /usr/share/doc/packages/perl-Business-ISBN-Data/Changes
+
+  20210112.004 2021-02-10T04:29:32Z
+       * Test the default data.
+       * Add a note about packaging RangeMessage.xml (adapted from gwyn17)
+
+-------------------------------------------------------------------
+Wed Feb 10 03:06:11 UTC 2021 - Tina M??ller <[email protected]>
+
+- updated to 20210112.003
+   see /usr/share/doc/packages/perl-Business-ISBN-Data/Changes
+
+  20210112.003 2021-02-09T22:42:53Z
+       * The default data had a problem because I used the same hash key
+       twice in the default data (Github #7). Found by gwyn17.
+
+-------------------------------------------------------------------
+Mon Feb  8 03:06:13 UTC 2021 - Tina M??ller <[email protected]>
+
+- updated to 20210112.002
+   see /usr/share/doc/packages/perl-Business-ISBN-Data/Changes
+
+  20210112.002 2021-02-07T05:46:20Z
+       * Don't try to load a data file if there are no data files
+       (Github #6)
+
+-------------------------------------------------------------------

Old:
----
  Business-ISBN-Data-20210112.001.tar.gz

New:
----
  Business-ISBN-Data-20210112.006.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ perl-Business-ISBN-Data.spec ++++++
--- /var/tmp/diff_new_pack.lo3Joo/_old  2021-02-17 18:09:59.697864762 +0100
+++ /var/tmp/diff_new_pack.lo3Joo/_new  2021-02-17 18:09:59.697864762 +0100
@@ -18,7 +18,7 @@
 
 %define cpan_name Business-ISBN-Data
 Name:           perl-Business-ISBN-Data
-Version:        20210112.001
+Version:        20210112.006
 Release:        0
 Summary:        Data pack for Business::ISBN
 License:        Artistic-2.0
@@ -33,10 +33,13 @@
 
 %description
 You don't need to load this module yourself in most cases. Business::ISBN
-will load it when it loads.
+will load it when it loads. You must use Business::ISBN 3.005 or later
+because the data structure changed slightly to fix a bug with ISBN13
+prefixes.
 
 These data are generated from the _RangeMessage.xml_ file provided by the
-ISBN Agency. You can retrieve this yourself at
+ISBN Agency. The distributed version matches the date in the version for
+this module. You can retrieve this yourself at
 https://www.isbn-international.org/range_file_generation. This file is
 included as part of the distribution and should be installed at
 _~lib/Business/ISBN/Data/RangeMessage.xml_.
@@ -48,8 +51,8 @@
 to this module.
 
 If the default _RangeMessage.xml_ or your alternate one is not available,
-the module falls back to data included in _Data.pm_. However, that data is
-likely to be older data. If it does not find that file, it looks for
+the module falls back to data included in _Data.pm_. However, that data are
+likely to be older. If it does not find that file, it looks for
 _RangeMessage.xml_ in the current directory.
 
 The data are in '%Business::ISBN::country_data' (although the "country"
@@ -58,6 +61,7 @@
 
 %prep
 %autosetup  -n %{cpan_name}-%{version}
+find . -type f ! -path "*/t/*" ! -name "*.pl" ! -path "*/bin/*" ! -path 
"*/script/*" ! -name "configure" -print0 | xargs -0 chmod 644
 
 %build
 perl Makefile.PL INSTALLDIRS=vendor

++++++ Business-ISBN-Data-20210112.001.tar.gz -> 
Business-ISBN-Data-20210112.006.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Business-ISBN-Data-20210112.001/Changes 
new/Business-ISBN-Data-20210112.006/Changes
--- old/Business-ISBN-Data-20210112.001/Changes 2021-01-19 15:48:41.000000000 
+0100
+++ new/Business-ISBN-Data-20210112.006/Changes 2021-02-16 05:09:37.000000000 
+0100
@@ -1,4 +1,38 @@
-Revision history for Perl module 
+Revision history for Perl module Business::ISBN::Data
+
+20210112.006 2021-02-16T04:08:08Z
+       * Fix testing bug. This module needs Business::ISBN 3.005 to match 
+       the data structures. Prior to that, Business::ISBN had a bug with
+       ISBN13.
+
+20210112.005_03 2021-02-15T17:43:08Z
+       * I think the CPAN Tester failures are using older versions of
+       Business::ISBN (older than 3.005 all seem to fail). I assumed they
+       started fresh, but I guess not. Require a recent version in the
+       default_data test.
+
+20210112.005_02 2021-02-14T05:07:05Z
+       * Try harder to see what's going on in CPAN Testers
+
+20210112.005_01 2021-02-13T12:40:28Z
+       * Try harder to figure out these test failures
+
+20210112.005 2021-02-13T05:23:58Z
+       * Fix the default data test. It should only run when you have 
+       Business::ISBN already, and it shouldn't do stupid things like
+       using an array that I didn't put anything in.
+
+20210112.004 2021-02-10T04:29:32Z
+       * Test the default data.
+       * Add a note about packaging RangeMessage.xml (adapted from gwyn17)
+
+20210112.003 2021-02-09T22:42:53Z
+       * The default data had a problem because I used the same hash key
+       twice in the default data (Github #7). Found by gwyn17.
+
+20210112.002 2021-02-07T05:46:20Z
+       * Don't try to load a data file if there are no data files
+       (Github #6)
 
 20210112.001 2021-01-19T14:48:12Z
        * freshen distro, dump Travis CI, add Github Actions
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Business-ISBN-Data-20210112.001/MANIFEST 
new/Business-ISBN-Data-20210112.006/MANIFEST
--- old/Business-ISBN-Data-20210112.001/MANIFEST        2021-01-19 
15:48:44.000000000 +0100
+++ new/Business-ISBN-Data-20210112.006/MANIFEST        2021-02-16 
05:09:39.000000000 +0100
@@ -12,6 +12,7 @@
 MANIFEST.SKIP
 README.pod
 t/check_data_structure.t
+t/default_data.t
 t/load.t
 t/pod.t
 t/pod_coverage.t
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Business-ISBN-Data-20210112.001/META.json 
new/Business-ISBN-Data-20210112.006/META.json
--- old/Business-ISBN-Data-20210112.001/META.json       2021-01-19 
15:48:43.000000000 +0100
+++ new/Business-ISBN-Data-20210112.006/META.json       2021-02-16 
05:09:38.000000000 +0100
@@ -4,7 +4,7 @@
       "brian d foy <[email protected]>"
    ],
    "dynamic_config" : 1,
-   "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter 
version 2.150010",
+   "generated_by" : "ExtUtils::MakeMaker version 7.44, CPAN::Meta::Converter 
version 2.150010",
    "license" : [
       "artistic_2"
    ],
@@ -55,6 +55,6 @@
          "web" : "https://github.com/briandfoy/business-isbn-data";
       }
    },
-   "version" : "20210112.001",
-   "x_serialization_backend" : "JSON::PP version 4.02"
+   "version" : "20210112.006",
+   "x_serialization_backend" : "JSON::PP version 4.04"
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Business-ISBN-Data-20210112.001/META.yml 
new/Business-ISBN-Data-20210112.006/META.yml
--- old/Business-ISBN-Data-20210112.001/META.yml        2021-01-19 
15:48:43.000000000 +0100
+++ new/Business-ISBN-Data-20210112.006/META.yml        2021-02-16 
05:09:38.000000000 +0100
@@ -8,7 +8,7 @@
   ExtUtils::MakeMaker: '6.64'
   File::Spec::Functions: '0'
 dynamic_config: 1
-generated_by: 'ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 
2.150010'
+generated_by: 'ExtUtils::MakeMaker version 7.44, CPAN::Meta::Converter version 
2.150010'
 license: artistic_2
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -27,5 +27,5 @@
   bugtracker: https://github.com/briandfoy/business-isbn-data/issues
   homepage: https://github.com/briandfoy/business-isbn-data
   repository: https://github.com/briandfoy/business-isbn-data.git
-version: '20210112.001'
+version: '20210112.006'
 x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Business-ISBN-Data-20210112.001/README.pod 
new/Business-ISBN-Data-20210112.006/README.pod
--- old/Business-ISBN-Data-20210112.001/README.pod      2021-01-19 
15:48:41.000000000 +0100
+++ new/Business-ISBN-Data-20210112.006/README.pod      2021-02-16 
05:09:37.000000000 +0100
@@ -2,11 +2,11 @@
 
 =encoding utf8
 
-=for HTML <a href="../../actions?query=workflow%3Amacos"><img 
src="../../workflows/macos/badge.svg"></a>
+=for HTML <a 
href="https://www.github.com/briandfoy/business-isbn-data/actions?query=workflow%3Amacos";><img
 
src="https://www.github.com/briandfoy/business-isbn-data/workflows/macos/badge.svg";></a>
 
-=for HTML <a href="../../actions?query=workflow%3Aubuntu"><img 
src="../../workflows/ubuntu/badge.svg"></a>
+=for HTML <a 
href="https://www.github.com/briandfoy/business-isbn-data/actions?query=workflow%3Aubuntu";><img
 
src="https://www.github.com/briandfoy/business-isbn-data/workflows/ubuntu/badge.svg";></a>
 
-=for HTML <a href="../../actions?query=workflow%3Awindows"><img 
src="../../workflows/windows/badge.svg"></a>
+=for HTML <a 
href="https://www.github.com/briandfoy/business-isbn-data/actions?query=workflow%3Awindows";><img
 
src="https://www.github.com/briandfoy/business-isbn-data/workflows/windows/badge.svg";></a>
 
 =for HTML <a 
href='https://ci.appveyor.com/project/briandfoy/business-isbn-data'><img 
src='https://ci.appveyor.com/api/projects/status/v9isunqajl3h3ftf' /></a>
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/Business-ISBN-Data-20210112.001/examples/make_default_data.pl 
new/Business-ISBN-Data-20210112.006/examples/make_default_data.pl
--- old/Business-ISBN-Data-20210112.001/examples/make_default_data.pl   
2021-01-19 15:48:41.000000000 +0100
+++ new/Business-ISBN-Data-20210112.006/examples/make_default_data.pl   
2021-02-16 05:09:37.000000000 +0100
@@ -5,9 +5,72 @@
 use lib qw(lib);
 use Business::ISBN::Data;
 
+my $file = $ARGV[0];
 
+=encoding utf8
 
-my $file = $ARGV[0];
+=head1 NAME
+
+make_default_data.pl
+
+=head1 SYNOPSIS
+
+       % curl https://www.isbn-international.org/?q=download_range/15821 > 
RangeMessage.xml
+       % perl make_default_data.pl RangeMessage.xml
+
+       # cut and paste result into lib/Business/ISBN/Data.pm
+
+=head1 DESCRIPTION
+
+This program takes the F<RangeMessage.xml> and makes the data
+structure to hard-code into L<Business::ISBN::Data>.
+
+The module ships with the F<RangeMessage.xml> that was current as of
+the release of the module, but it also hard-codes the same data. That
+way, the module has the data even if the XML file disappears. The
+module can also use any F<RangeMessage.xml> you specify, which allows
+you to use updated (or even past) data. The hard-coded data always
+gets you back to that for the release.
+
+=head1 SOURCE AVAILABILITY
+
+This module lives in a Github repository:
+
+       https://github.com/briandfoy/business-isbn-data.git
+
+You are probably also interested in the module that uses it:
+
+       https://github.com/briandfoy/business-isbn.git
+
+If you have something to add, create a fork on Github and send a
+pull request.
+
+=head1 AUTHOR
+
+brian d foy, C<< <[email protected]> >>
+
+Yakov Shafranovich updated the data in October 2008.
+
+Daniel Jakubik updated the data in July 2012.
+
+Markus Spann suggested looking for F<RangeMessage.xml> in the current
+directory to make it work with Perl app bundlers.
+
+Josef Moravec C<< <[email protected]> >> updated the data in January 
2019.
+
+Peter Williams fixed a serious issue with ISBN-13 (GitHub #5)
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright ?? 2002-2021, brian d foy <[email protected]>. All rights reserved.
+
+You may redistribute this under the terms of the Artistic License 2.0.
+
+=cut
+
+
+do { warn "Usage: $0 RangeMessage.xml\n"; exit(2)  } unless defined $file;
+do { warn "File <$file> does not exist\n"; exit(2) } unless -e $file;
 
 my $data = Business::ISBN::Data::_parse_range_message( $file );
 
@@ -20,7 +83,7 @@
        $string .= sprintf "\t%-10s => %s,\n", $key, $value;
        }
 
-$string .= "\t978 => \{\n%%978%%\n\t\},\n\t978 => \{\n%%979%%\n\t\},\n\t);";
+$string .= "\t978 => \{\n%%978%%\n\t\},\n\t979 => \{\n%%979%%\n\t\},\n\t);";
 
 foreach my $k ( qw(978 979) ) {
        my $s = "\t\t" . join "\n\t\t",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/Business-ISBN-Data-20210112.001/lib/Business/ISBN/Data.pm 
new/Business-ISBN-Data-20210112.006/lib/Business/ISBN/Data.pm
--- old/Business-ISBN-Data-20210112.001/lib/Business/ISBN/Data.pm       
2021-01-19 15:48:41.000000000 +0100
+++ new/Business-ISBN-Data-20210112.006/lib/Business/ISBN/Data.pm       
2021-02-16 05:09:37.000000000 +0100
@@ -3,11 +3,11 @@
 package Business::ISBN::Data;
 use strict;
 
-use Carp qw(carp);
-use File::Basename qw(dirname);
+use Carp                  qw(carp);
+use File::Basename        qw(dirname);
 use File::Spec::Functions qw(catfile);
 
-our $VERSION = '20210112.001';
+our $VERSION = '20210112.006';
 
 =encoding utf8
 
@@ -22,10 +22,13 @@
 =head1 DESCRIPTION
 
 You don't need to load this module yourself in most cases. L<Business::ISBN>
-will load it when it loads.
+will load it when it loads. You must use L<Business::ISBN> 3.005 or later
+because the data structure changed slightly to fix a bug with ISBN13
+prefixes.
 
 These data are generated from the F<RangeMessage.xml> file provided by
-the ISBN Agency. You can retrieve this yourself at 
L<https://www.isbn-international.org/range_file_generation>.
+the ISBN Agency. The distributed version matches the date in the version
+for this module. You can retrieve this yourself at 
L<https://www.isbn-international.org/range_file_generation>.
 This file is included as part of the distribution and should be installed
 at F<~lib/Business/ISBN/Data/RangeMessage.xml>.
 
@@ -37,13 +40,41 @@
 
 If the default F<RangeMessage.xml> or your alternate one is not available,
 the module falls back to data included in F<Data.pm>. However, that data
-is likely to be older data. If it does not find that file, it looks
+are likely to be older. If it does not find that file, it looks
 for F<RangeMessage.xml> in the current directory.
 
 The data are in C<%Business::ISBN::country_data> (although the "country"
 part is historical). If you want to see where the data are from, check
 C<$Business::ISBN::country_data{_source}>.
 
+=head2 Packaging this module
+
+The included F<RangeMessage.xml> is in under F<lib/> at the same level
+as F<Data.pm>. The same data exist as the default data in the code, so
+you don't need to pass along the distributed F<RangeMessage.xml>.
+However, you can include a newer F<RangeMessage.xml>.
+
+With PAR, you can add extra files to the archive with C<-a>. Put the
+new file somewhere the module will find it (or use C<ISBN_RANGE_MESSAGE>
+to lead it there):
+
+       pp ... -a '..../RangeMessage.xml;RangeMessage.xml'
+
+If you put the F<RangeMessage.xml> in the current working directory of
+the application, the module should find it.
+
+=head2 Updating the default data
+
+In the repo, find the F<examples/make_default_data.pl> program. Run
+that against the latest F<RangeMessage.xml>:
+
+       % perl -Ilib examples/make_default_data.pl RangeMessage.xml
+
+That produces the code you need to replace in the module. Check that
+that data aren't weird: sometimes the group names have errors or
+oddities. The program handles escaping single quotes and trimming
+white space.
+
 =head1 SOURCE AVAILABILITY
 
 This module lives in a Github repository:
@@ -70,7 +101,8 @@
 
 Josef Moravec C<< <[email protected]> >> updated the data in January 
2019.
 
-Peter Williams fixed a serious issue with ISBN-13 (GitHub #5)
+Peter Williams fixed a serious issue with ISBN-13 (GitHub #5). You must
+use Business::ISBN 3.005 or later because the data structure changed.
 
 =head1 COPYRIGHT AND LICENSE
 
@@ -82,7 +114,7 @@
 
 sub _default_data {
        (
-       _data_date => '20120112',
+       _data_date => '20210112',
        _serial    => '0c5e7d67-d086-48c1-80f9-55319988b0c0',
        _source    => __FILE__,
        978 => {
@@ -335,7 +367,7 @@
                99986 => [ 'Myanmar'                      => [ '0', '0', '50', 
'69', '950', '999' ] ],
                99987 => [ 'Luxembourg'                   => [ '850', '999' ] ],
        },
-       978 => {
+       979 => {
                8     => [ 'United States'                => [ '200', '219', 
'5500', '7499', '9850000', '9850009' ] ],
                10    => [ 'France'                       => [ '00', '19', 
'200', '699', '7000', '8999', '90000', '97599', '976000', '999999' ] ],
                11    => [ 'Korea, Republic'              => [ '00', '24', 
'250', '549', '5500', '8499', '85000', '94999', '950000', '999999' ] ],
@@ -351,6 +383,7 @@
        if( defined $ENV{ISBN_RANGE_MESSAGE} and ! -e $ENV{ISBN_RANGE_MESSAGE} 
) {
                carp "ISBN_RANGE_MESSAGE is set to [$ENV{ISBN_RANGE_MESSAGE}] 
but that file does not exist!\nTrying to use the default locations\n";
                }
+
        my $file = 'RangeMessage.xml';
        no warnings 'uninitialized';
        my @candidates = grep { -e } (
@@ -359,7 +392,9 @@
                $file,                                 # current directory
                );
 
-       my $hash = _parse_range_message( $candidates[0] );
+       my $hash;
+
+       $hash = _parse_range_message( $candidates[0] ) if @candidates;
 
        if( defined $hash ) { return %$hash   }
        else                { _default_data() }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/Business-ISBN-Data-20210112.001/t/check_data_structure.t 
new/Business-ISBN-Data-20210112.006/t/check_data_structure.t
--- old/Business-ISBN-Data-20210112.001/t/check_data_structure.t        
2021-01-19 15:48:41.000000000 +0100
+++ new/Business-ISBN-Data-20210112.006/t/check_data_structure.t        
2021-02-16 05:09:37.000000000 +0100
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-use Test::More 0.95;
+use Test::More;
 
 use File::Spec::Functions qw(catfile);
 
@@ -9,14 +9,12 @@
        ok( %Business::ISBN::country_data );
        };
 
-subtest 'current_data' => sub {
+subtest 'included_range_message' => sub {
        # Test with included RangeMessage.xml in the same spot as the module
        like( $Business::ISBN::country_data{_source}, qr/RangeMessage\.xml/ );
        like( $Business::ISBN::country_data{_source}, qr/blib/ );
-       foreach my $isbn_prefix ("978", "979")
-               {
-               foreach my $key ( sort { $a <=> $b } grep { ! /\A_/ } keys %{ 
$Business::ISBN::country_data{$isbn_prefix} } )
-                       {
+       foreach my $isbn_prefix ("978", "979") {
+               foreach my $key ( sort { $a <=> $b } grep { ! /\A_/ } keys %{ 
$Business::ISBN::country_data{$isbn_prefix} } ) {
                        my $value = 
$Business::ISBN::country_data{$isbn_prefix}->{$key};
                        isa_ok( $value, ref [], "Value is array ref for country 
$key" );
 
@@ -30,17 +28,15 @@
        };
 
 
-subtest 'current_data' => sub {
+subtest 'env_range_message' => sub {
        # Test with RangeMessage.xml set in ISBN_RANGE_MESSAGE
        local $ENV{ISBN_RANGE_MESSAGE} = catfile( qw(lib Business ISBN 
RangeMessage.xml) );
        local %Business::ISBN::country_data = Business::ISBN::Data::_get_data();
        ok( -e $ENV{ISBN_RANGE_MESSAGE}, 'Alternate RangeMessage.xml exists' );
        unlike( $Business::ISBN::country_data{_source}, qr/blib/ );
        like( $Business::ISBN::country_data{_source}, qr/RangeMessage\.xml/ );
-       foreach my $isbn_prefix ("978", "979")
-               {
-               foreach my $key ( sort { $a <=> $b } grep { ! /\A_/ } keys %{ 
$Business::ISBN::country_data{$isbn_prefix} } )
-                       {
+       foreach my $isbn_prefix ("978", "979") {
+               foreach my $key ( sort { $a <=> $b } grep { ! /\A_/ } keys %{ 
$Business::ISBN::country_data{$isbn_prefix} } ) {
                        my $value = 
$Business::ISBN::country_data{$isbn_prefix}->{$key};
                        isa_ok( $value, ref [], "Value is array ref for country 
$key" );
 
@@ -53,15 +49,29 @@
                }
        };
 
-subtest 'current_data' => sub {
+subtest 'missing_range_message' => sub {
+       # Test with RangeMessage.xml set in ISBN_RANGE_MESSAGE
+
+       my $file = catfile( qw(blib lib Business ISBN RangeMessage.xml) );
+       my $out_of_the_way = $file . '.hidden';
+
+       rename $file => $out_of_the_way;
+
+       ok( ! -e $file, 'RangeMessage.xml is out of the way' );
+       local %Business::ISBN::country_data = Business::ISBN::Data::_get_data();
+
+       like( $Business::ISBN::country_data{_source}, qr/\bData\.pm/, 'Data 
source is the default data structure' );
+
+       rename $out_of_the_way => $file;
+       };
+
+subtest 'default_data' => sub {
        # Test with default data
        local %Business::ISBN::country_data = 
Business::ISBN::Data::_default_data();
        like( $Business::ISBN::country_data{_source}, qr/Data\.pm/ );
 
-       foreach my $isbn_prefix ("978", "979")
-               {
-               foreach my $key ( sort { $a <=> $b } grep { ! /\A_/ } keys %{ 
$Business::ISBN::country_data{$isbn_prefix} } )
-                       {
+       foreach my $isbn_prefix ("978", "979") {
+               foreach my $key ( sort { $a <=> $b } grep { ! /\A_/ } keys %{ 
$Business::ISBN::country_data{$isbn_prefix} } ) {
                        my $value = 
$Business::ISBN::country_data{$isbn_prefix}->{$key};
                        isa_ok( $value, ref [], "Value is array ref for country 
$key" );
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Business-ISBN-Data-20210112.001/t/default_data.t 
new/Business-ISBN-Data-20210112.006/t/default_data.t
--- old/Business-ISBN-Data-20210112.001/t/default_data.t        1970-01-01 
01:00:00.000000000 +0100
+++ new/Business-ISBN-Data-20210112.006/t/default_data.t        2021-02-16 
05:09:37.000000000 +0100
@@ -0,0 +1,54 @@
+#!/usr/bin/perl
+
+# If you run into an ISBN that you think is valid but this module
+# says is invalid, put it here.
+#
+# Grab the latest RangeMessage.xml file and see if the distributed
+# data is just out of date.
+my @isbns_from_issues = qw(
+       9782021183061
+       );
+
+
+use Test::More;
+
+use Data::Dumper;
+use File::Spec::Functions qw(catfile);
+
+SKIP: {
+       my $tests = @isbns_from_issues + 3;
+       skip "Need Business::ISBN 3.006 to run this test", $tests unless eval {
+               require Business::ISBN;
+               # 3.005 fixed a major problem with 979 numbers and the data
+               # structure changed.
+               Business::ISBN->VERSION('3.006');
+               };
+
+       diag( "Business::ISBN is " . Business::ISBN->VERSION );
+
+       my $file = catfile( qw(blib lib Business ISBN RangeMessage.xml) );
+       my $out_of_the_way = $file . '.hidden';
+
+       ok( rename($file => $out_of_the_way), 'Renamed file' );
+
+       subtest 'compile' => sub {
+               my @modules = qw( Business::ISBN::Data );
+               foreach my $module ( @modules ) {
+                       BAIL_OUT( "Could not load $module" ) unless eval{ 
use_ok( $module ) };
+                       }
+               };
+
+       local %Business::ISBN::country_data = Business::ISBN::Data::_get_data();
+       like( $Business::ISBN::country_data{_source}, qr/\bData\.pm/, 'Data 
source is the default data structure' );
+
+       subtest 'check_isbns' => sub {
+               foreach my $isbn ( @isbns_from_issues ) {
+                       my $i = Business::ISBN->new( $isbn );
+                       ok( $i->is_valid, "<$isbn> is valid" );
+                       }
+               };
+
+       rename $out_of_the_way => $file;
+       }
+
+done_testing();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Business-ISBN-Data-20210112.001/t/load.t 
new/Business-ISBN-Data-20210112.006/t/load.t
--- old/Business-ISBN-Data-20210112.001/t/load.t        2021-01-19 
15:48:41.000000000 +0100
+++ new/Business-ISBN-Data-20210112.006/t/load.t        2021-02-16 
05:09:37.000000000 +0100
@@ -1,10 +1,14 @@
-BEGIN {
-       @classes = qw(Business::ISBN::Data);
-       }
+#!/usr/bin/perl
 
-use Test::More tests => scalar @classes;
-       
-foreach my $class ( @classes )
-       {
-       print "bail out! $class did not compile!" unless use_ok( $class );
-       }
+my @modules = qw(Business::ISBN::Data);
+
+use Test::More;
+
+subtest 'compile' => sub {
+       foreach my $module ( @modules ) {
+               BAIL_OUT( "Could not load $module" ) unless use_ok( $module );
+               }
+       diag( "Business::ISBN::Data " . Business::ISBN::Data->VERSION );
+       };
+
+done_testing();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Business-ISBN-Data-20210112.001/t/pod_coverage.t 
new/Business-ISBN-Data-20210112.006/t/pod_coverage.t
--- old/Business-ISBN-Data-20210112.001/t/pod_coverage.t        2021-01-19 
15:48:41.000000000 +0100
+++ new/Business-ISBN-Data-20210112.006/t/pod_coverage.t        2021-02-16 
05:09:37.000000000 +0100
@@ -1,13 +1,10 @@
 use Test::More;
 eval "use Test::Pod::Coverage";
 
-if( $@ )
-       {
+if( $@ ) {
        plan skip_all => "Test::Pod::Coverage required for testing POD";
        }
-else
-       {
+else {
        plan tests => 1;
-
-       pod_coverage_ok( "Business::ISBN::Data" );      
+       pod_coverage_ok( "Business::ISBN::Data" );
        }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Business-ISBN-Data-20210112.001/t/test_manifest 
new/Business-ISBN-Data-20210112.006/t/test_manifest
--- old/Business-ISBN-Data-20210112.001/t/test_manifest 2021-01-19 
15:48:41.000000000 +0100
+++ new/Business-ISBN-Data-20210112.006/t/test_manifest 2021-02-16 
05:09:37.000000000 +0100
@@ -2,3 +2,4 @@
 pod.t
 pod_coverage.t
 check_data_structure.t
+default_data.t

Reply via email to