/[webpac2]/trunk/t/3-normalize-marc.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/t/3-normalize-marc.t

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1108 by dpavlin, Sun Aug 31 09:14:18 2008 UTC revision 1109 by dpavlin, Sat Sep 6 09:54:08 2008 UTC
# Line 3  Line 3 
3  use strict;  use strict;
4  use blib;  use blib;
5    
6  use Test::More tests => 325;  use Test::More tests => 330;
7    
8  BEGIN {  BEGIN {
9          use_ok( 'WebPAC::Test' );          use_ok( 'WebPAC::Test' );
# Line 129  foreach my $from ( 0 .. $max_occ - 1 ) { Line 129  foreach my $from ( 0 .. $max_occ - 1 ) {
129  }  }
130    
131  sub test_marc_clone {  sub test_marc_clone {
132          my $rec = shift;          my ( $rec, $expect ) = @_;
133    
134          ok( _clean_ds(), '_clean_ds' );          ok( _clean_ds(), '_clean_ds' );
135          ok( _set_ds( $rec ), '_set_ds' );          ok( _set_ds( $rec ), '_set_ds' );
136    
137          ok( marc_clone, 'marc_clone' );          ok( ! marc_clone, 'marc_clone' );
138    
139          ok(my $marc = WebPAC::Normalize::MARC::_get_marc_fields(), "_get_marc_fields");          ok(my $marc = WebPAC::Normalize::MARC::_get_marc_fields(), "_get_marc_fields");
140          diag "rec = ",dump( $rec );  #       diag "rec = ",dump( $rec );
141          diag "marc = ",dump( $marc );  #       diag "marc = ",dump( $marc );
142    #       diag "expect = ",dump( $marc );
143    
144          is_deeply( $rec, $marc, 'same' );          is_deeply( $marc, $expect, 'marc_clone same' );
145    
146  }  }
147    
148  test_marc_clone( {  test_marc_clone( {
149          '900' => [{ 'a' => '900a', 'b' => '900b',       subfields => [ qw/a 0 b 0/ ]    }],          '900' => [{ 'a' => '900a', 'b' => '900b',       subfields => [ qw/a 0 b 0/ ]    }],
150          '901' => [{ 'c' => '901c',                                      subfields => [ qw/c 0/ ]                }],          '901' => [{ 'c' => '901c',                                      subfields => [ qw/c 0/ ]                }],
151  } );  }, [
152       [900, " ", " ", "a", "900a", "b", "900b"],
153       [901, " ", " ", "c", "901c"],
154    ] );
155    

Legend:
Removed from v.1108  
changed lines
  Added in v.1109

  ViewVC Help
Powered by ViewVC 1.1.26