/[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 1012 by dpavlin, Sun Nov 4 13:27:12 2007 UTC revision 1013 by dpavlin, Wed Nov 7 11:54:34 2007 UTC
# Line 514  sub test_s { Line 514  sub test_s {
514                  _clean_ds();                  _clean_ds();
515                  _set_ds($rec);                  _set_ds($rec);
516    
517                  foreach my $r (split(/;/, $rules)) {                  foreach my $r (split(/;\s*$/, $rules)) {
518                          $r =~ s/[\s\n\r]+/ /gs;                          $r =~ s/[\s\n\r]+/ /gs;
519                          $r =~ s/^\s+//gs;                          $r =~ s/^\s+//gs;
520                          $r =~ s/\s+$//gs;                          $r =~ s/\s+$//gs;
521                            diag "rule: $r" if $debug;
522                          test_s($r) if ($r);                          test_s($r) if ($r);
523                  }                  }
524    
# Line 863  sub test_s { Line 864  sub test_s {
864                  [ '1-55860-701-3', '1-55860-701-3' ],                  [ '1-55860-701-3', '1-55860-701-3' ],
865          'isbn_10' );          'isbn_10' );
866    
867            # marc_template
868    
869            test_rec_rules(
870                    'marc_template',
871                    {
872                            '225' => [{
873                                    'a' => 'a-1-1',
874                                    'i' => 'i-1-1',
875                                    'v' => 'v-1-1',
876                                    'w' => 'w-1-1',
877                                    'h' => 'h-1-1',
878                                    'x' => 'x-1-1',
879                            },{
880                                    'a' => 'a-2-1',
881                                    'v' => 'v-2-1',
882                                    'i' => 'i-2-1',
883                            },{
884                                    'a' => 'a-3-1',
885                                    'i' => 'i-3-1',
886                                    'v' => 'v-3-1',
887                            },{
888                                    'a' => 'a-4-1',
889                                    'v' => 'v-4-1',
890                                    'i' => 'i-4-1',
891                                    'w' => 'w-4-1',
892                            }],
893                    },
894                    qq{
895                            marc_template(
896                                    from => 225, to => 440,
897                                    subfields_rename => [
898                                            'a' => 'a',
899                                            'x' => 'x',
900                                            'v' => 'v',
901                                            'h' => 'n',
902                                            'i' => 'p',
903                                            'w' => 'v',
904                                    ],
905                                    marc_template => [
906                                            'a, |x ; |v. |n, |p ; |v',
907                                            'a ; |v. |p ; |v',
908                                            'a. |p ; |v',
909                                    ],
910                            );
911                    },
912                    [
913                            [440, " ", " ",
914                                    ["a", "a-1-1"],
915                                    ["x", "x-1-1"],
916                                    ["v", "v-1-1"],
917                                    ["n", "h-1-1"],
918                                    ["p", "i-1-1"],
919                                    ["v", "w-1-1"],
920                            ],
921                            [440, " ", " ", ["a", "a-2-1"], ["p", "i-2-1"], ["v", "v-2-1"]],
922                            [440, " ", " ", ["a", "a-3-1"], ["p", "i-3-1"], ["v", "v-3-1"]],
923                            [440, " ", " ",
924                                    ["a", "a-4-1"],
925                                    ["v", "v-4-1"],
926                                    ["p", "i-4-1"],
927                                    ["v", "w-4-1"],
928                            ],
929                    ],
930            );
931  }  }
932    

Legend:
Removed from v.1012  
changed lines
  Added in v.1013

  ViewVC Help
Powered by ViewVC 1.1.26