File: check_data_structure.t

package info (click to toggle)
libbusiness-isbn-data-perl 20081208-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze, wheezy
  • size: 124 kB
  • ctags: 4
  • sloc: perl: 267; makefile: 17
file content (18 lines) | stat: -rw-r--r-- 462 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/perl

use Test::More 'no_plan';

use_ok( 'Business::ISBN::Data' );
ok( defined %Business::ISBN::country_data );

foreach my $key ( sort { $a <=> $b } keys %Business::ISBN::country_data )
	{
	my $value = $Business::ISBN::country_data{$key};
	isa_ok( $value, ref [], "Value is array ref for country $key" );
	
	my( $country, $ranges ) = @$value;
	
	my $count = @$ranges;

	ok( ($count % 2) == 0, "Even number of elements ($count) for country $key" );
	}