1#!perl -Tw 2 3# $Id: title_proper.t,v 1.6 2005/01/05 04:30:24 eijabb Exp $ 4 5use strict; 6use integer; 7use File::Spec; 8use Test::More tests=>14; 9 10BEGIN { 11 use_ok( 'MARC::File::USMARC' ); 12} 13 14my @titles = ( 15 'Current population reports. Series P-20, Population characteristics.', 16 'Current population reports. Series P-60, Consumer income.', 17 'Physical review. A, Atomic, molecular, and optical physics', 18 'Physical review. B, Condensed matter', 19 'America and the British Labour Party :', 20); 21 22my $filename = File::Spec->catfile( 't', 'title_proper.usmarc' ); 23my $file = MARC::File::USMARC->in( $filename ); 24isa_ok( $file, 'MARC::File::USMARC', 'USMARC file' ); 25 26while ( my $marc = $file->next() ) { 27 isa_ok( $marc, 'MARC::Record', 'Got a record' ); 28 29 my $title = shift @titles; 30 is( $marc->title_proper, $title ); 31} 32ok( !$MARC::File::ERROR, "Should have no error" ); 33is( scalar @titles, 0, "no titles left to check" ); 34 35$file->close; 36 37