/[webpac2]/trunk/t/3-normalize.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.t

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

revision 813 by dpavlin, Sun Apr 1 21:47:47 2007 UTC revision 819 by dpavlin, Wed Apr 11 10:09:34 2007 UTC
# Line 2  Line 2 
2    
3  use strict;  use strict;
4    
5  use Test::More tests => 332;  use Test::More tests => 341;
6  use Test::Exception;  use Test::Exception;
7  use Cwd qw/abs_path/;  use Cwd qw/abs_path/;
8  use blib;  use blib;
# Line 191  sub test_s { Line 191  sub test_s {
191    
192          # simple list manipulatons          # simple list manipulatons
193          cmp_ok( join('', prefix('ab', 'cd') ), 'eq', 'abcd', 'prefix');          cmp_ok( join('', prefix('ab', 'cd') ), 'eq', 'abcd', 'prefix');
194            cmp_ok( join('-', prefix('', 'x', 'y') ), 'eq', 'x-y', 'prefix empty');
195            cmp_ok( join('-', prefix(0, 'x', 'y') ), 'eq', '0x-0y', 'prefix 0');
196    
197          cmp_ok( join('', suffix('xy', 'cd') ), 'eq', 'cdxy', 'suffix');          cmp_ok( join('', suffix('xy', 'cd') ), 'eq', 'cdxy', 'suffix');
198            cmp_ok( join('-', suffix('', 'x', 'y' ) ), 'eq', 'x-y', 'suffix empty');
199            cmp_ok( join('-', suffix(0, 'x', 'y' ) ), 'eq', 'x0-y0', 'suffix 0');
200    
201          cmp_ok( join('', surround('->', '<-', 'a','b','c') ), 'eq', '->a<-->b<-->c<-', 'surround');          cmp_ok( join('', surround('->', '<-', 'a','b','c') ), 'eq', '->a<-->b<-->c<-', 'surround');
202            cmp_ok( join('-', surround('', '', 'x','y','z') ), 'eq', 'x-y-z', 'surround empty');
203            cmp_ok( join('-', surround(0, 0, 'x','y','z') ), 'eq', '0x0-0y0-0z0', 'surround 0 0');
204    
205          # count          # count
206          my @el;          my @el;
# Line 835  sub test_s { Line 843  sub test_s {
843                  '^aa1^bb1^aa2^bb2^cc1^cc2',                  '^aa1^bb1^aa2^bb2^cc1^cc2',
844                  '_pack_subfields_hash( $h, 1 )'                  '_pack_subfields_hash( $h, 1 )'
845          );          );
846    
847            _clean_ds();
848            test_s(qq{
849                    marc_fixed('008', 0, 'abcdef');
850                    marc_fixed('000', 5, '5');
851                    marc_fixed('000', 10, 'A');
852                    marc_fixed('000', 0, '0');
853            });
854            ok( my $m = WebPAC::Normalize::_get_marc_fields(), '_get_marc_fields');
855            diag dump( $m );
856            is_deeply( WebPAC::Normalize::_get_marc_fields(),
857                    [
858                            ["008", "abcdef"],
859                            #        0....5....10
860                            ["000", "0    5    A"]
861                    ]
862            );
863  }  }
864    

Legend:
Removed from v.813  
changed lines
  Added in v.819

  ViewVC Help
Powered by ViewVC 1.1.26