File: albania.t

package info (click to toggle)
libbusiness-isbn-perl 3.003-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,412 kB
  • ctags: 89
  • sloc: perl: 647; makefile: 7
file content (37 lines) | stat: -rw-r--r-- 1,324 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
use Test::More tests => 11;

use Business::ISBN;

$|++;

my $GOOD_ISBN          = "9992701579";
my $GOOD_ISBN_STRING   = "99927-0-157-9";
my $GROUP              = "Albania";
my $GROUP_CODE         = "99927";
my $PUBLISHER          = "0";
my $ARTICLE_CODE       = "157";
my $CHECKSUM           = "9";

# test to see if we can construct an object?
my $isbn = Business::ISBN->new( $GOOD_ISBN );
isa_ok( $isbn, 'Business::ISBN10' );

ok( defined $isbn->_max_group_code_length, "Data module imported" );

use Data::Dumper;
#print STDERR Data::Dumper->Dump( [$isbn], [qw($isbn)] );

is( $isbn->is_valid, Business::ISBN::GOOD_ISBN, "$GOOD_ISBN is valid" );

is( $isbn->group_code,     $GROUP_CODE,         "$GOOD_ISBN has right group code");
is( $isbn->publisher_code, $PUBLISHER,          "$GOOD_ISBN has right publisher");
is( $isbn->group,          $GROUP,              "$GOOD_ISBN has right group");
is( $isbn->article_code,   $ARTICLE_CODE,       "$GOOD_ISBN has right article code" );
is( $isbn->checksum,       $CHECKSUM,           "$GOOD_ISBN has right checksum" );
is( $isbn->_checksum,      $CHECKSUM,           "$GOOD_ISBN has right checksum" );




is( $isbn->as_string,      $GOOD_ISBN_STRING,   "$GOOD_ISBN stringifies correctly");
is( $isbn->as_string([]),  $GOOD_ISBN,          "$GOOD_ISBN stringifies correctly");