/[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 579 by dpavlin, Tue Jul 4 11:08:43 2006 UTC revision 631 by dpavlin, Wed Sep 6 14:25:16 2006 UTC
# Line 2  Line 2 
2    
3  use strict;  use strict;
4    
5  use Test::More tests => 147;  use Test::More tests => 155;
6  use Test::Exception;  use Test::Exception;
7  use Cwd qw/abs_path/;  use Cwd qw/abs_path/;
8  use blib;  use blib;
# Line 479  sub test_s { Line 479  sub test_s {
479                  ],                  ],
480          );          );
481    
482            test_rec_rules(
483                    'marc_compose with + subfields',
484                    { '200' => [{ a => 'foo ; bar', b => 42, c => 'baz' }] },
485                    qq{
486                            marc_compose('900',
487                                    'a', rec(200,'a'),
488                                    '+', prefix(" * ", rec(200,'c')),
489                                    'b', rec(200,'b'),
490                                    '+', prefix(" : ", rec(200,'c')),
491                            );
492                    },
493                    [
494                            [ '900', ' ', ' ', 'a', 'foo ; bar * baz', 'b', '42 : baz' ]
495                    ],
496            );
497    
498          #          #
499          # test rules          # test rules
500          #          #
# Line 628  sub test_s { Line 644  sub test_s {
644                  );                  );
645                  $i++;                  $i++;
646          }          }
647    
648            test_rec_rules(
649                    'marc_original_order',
650                    {
651                            '200' => [ {
652                                    a => [ 'a1', 'a2' ], b => [ 'b1', 'b2' ], c => [ 'c1', 'c2' ],
653                                    subfields => [ qw/a 0 b 0 a 1 b 1 c 0 c 1/ ],
654                            }, {
655                                    a => [ 'a3', 'a4', 'a5' ], b => 'b3', c => 'c3',
656                                    subfields => [ qw/a 0 a 1 b 0 c 0 a 2/ ],
657                            } ],
658                    },
659                    qq{
660                            marc_original_order(900,200);
661                    },
662                    [
663                            [ '900', ' ', ' ', 'a', 'a1', 'b', 'b1', 'a', 'a2', 'b', 'b2', 'c', 'c1', 'c', 'c2', ],
664                            [ '900', ' ', ' ', 'a', 'a3', 'a', 'a4', 'b', 'b3', 'c', 'c3', 'a', 'a5', ],
665                    ],
666            );
667    
668            test_rule(
669                    'rec1 skips subfields',
670                    {
671                            '200' => [ {
672                                    a => [ 'a1', 'a2' ], b => [ 'b1', 'b2' ], c => [ 'c1', 'c2' ],
673                                    subfields => [ qw/a 0 b 0 a 1 b 1 c 0 c 1/ ],
674                            }, {
675                                    a => [ 'a3', 'a4', 'a5' ], b => 'b3', c => 'c3',
676                                    subfields => [ qw/a 0 a 1 b 0 c 0 a 2/ ],
677                            } ],
678                    },
679                    qq{
680                            rec1(200);
681                    },
682                    ["a1", "b1", "a2", "b2", "c1", "c2"],
683            );
684  }  }
685    

Legend:
Removed from v.579  
changed lines
  Added in v.631

  ViewVC Help
Powered by ViewVC 1.1.26