[libcatmandu-marc-perl] 143/208: join subfields per field correctly

Jonas Smedegaard dr at jones.dk
Sat Oct 28 03:42:45 UTC 2017


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag upstream/1.19
in repository libcatmandu-marc-perl.

commit 6f22b5945f46682329b9477ba4ef16114b8d8f4f
Author: Carsten Klee <cKlee at users.noreply.github.com>
Date:   Mon May 29 12:22:31 2017 +0200

    join subfields per field correctly
---
 lib/Catmandu/MARC.pm      |  13 +--
 t/23-mapping_rules_spec.t | 217 ++++++++++++++++++++++++++++++++++++----------
 2 files changed, 177 insertions(+), 53 deletions(-)

diff --git a/lib/Catmandu/MARC.pm b/lib/Catmandu/MARC.pm
index 1a6692c..1ba5cea 100644
--- a/lib/Catmandu/MARC.pm
+++ b/lib/Catmandu/MARC.pm
@@ -16,7 +16,7 @@ memoize('parse_marc_spec');
 memoize('_it_subspecs');
 memoize('_get_index_range');
 
-our $VERSION = '1.11';
+our $VERSION = '1.10';
 
 sub marc_map {
     my $self      = $_[0];
@@ -444,7 +444,7 @@ sub marc_spec {
         } elsif($split) {
             push @{$referred}, @values
         } else {
-            push @{$referred}, join $join_char, @values
+            push @{$referred}, join $join_char, @values;
         }
     };
 
@@ -482,7 +482,9 @@ sub marc_spec {
             my $valid = $self->_it_subspecs( $data, $field_spec->tag, $field_spec->subspecs, $tag_index );
             next unless $valid
         }
-
+        
+        my @subfields = ();
+        
         if ( $ms->has_subfields ) {    # now we dealing with subfields
             for my $sf (@sf_spec) {
                 # set invert level
@@ -510,7 +512,7 @@ sub marc_spec {
 
                 if ( $invert_level == 3 ) { # no index or charpos
                     if (@subfield) {
-                        $to_referred->(@subfield)
+                        push @subfields, @subfield;
                     }
 
                     if ( $referred && $value_set ) { # return $value_set ASAP
@@ -569,8 +571,9 @@ sub marc_spec {
                     }
                 }
                 next unless @subfield;
-                $to_referred->(@subfield)
+                push @subfields, @subfield;
             } # end of subfield iteration
+            $to_referred->(@subfields) if @subfields;
         } # end of subfield handling
         else { # no particular subfields requested
             my @contents = ();
diff --git a/t/23-mapping_rules_spec.t b/t/23-mapping_rules_spec.t
index 5aec65d..a01c01a 100644
--- a/t/23-mapping_rules_spec.t
+++ b/t/23-mapping_rules_spec.t
@@ -37,7 +37,9 @@ my $mrc = <<'MRC';
 </marc:collection>
 MRC
 
-note 'marc_spec(245,title)     title: "Title / Name"';
+note "
+---
+".'marc_spec(245,title)     title: "Title / Name"';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -49,7 +51,9 @@ note 'marc_spec(245,title)     title: "Title / Name"';
     is_deeply $record->{title}, 'Title / Name', 'marc_spec(245,title)';
 }
 
-note 'marc_spec(245$a,title)    title: "Title / "';
+note "
+---
+".'marc_spec(245$a,title)    title: "Title / "';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -61,7 +65,9 @@ note 'marc_spec(245$a,title)    title: "Title / "';
     is_deeply $record->{title}, 'Title / ', 'marc_spec(245$a,title)';
 }
 
-note 'marc_spec(245,title.$append)     title: [ "Title / Name" ]';
+note "
+---
+".'marc_spec(245,title.$append)     title: [ "Title / Name" ]';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -73,7 +79,24 @@ note 'marc_spec(245,title.$append)     title: [ "Title / Name" ]';
     is_deeply $record->{title}, ['Title / Name'], 'marc_spec(245,title.$append)';
 }
 
-note 'add_field(title.$first, "first"); marc_spec(245,title.$append)     title: ["first", "Title / Name" ]';
+note "
+---
+".'marc_spec(245$a$c,title.$append)     title: [ "Title / Name" ]';
+{
+    my $importer = Catmandu->importer(
+        'MARC',
+        file => \$mrc,
+        type => 'XML',
+        fix  => 'marc_spec(245$a$c,title.$append); retain_field(title)'
+    );
+    my $record = $importer->first;
+    is_deeply $record->{title}, ['Title / Name'], 'marc_spec(245$a$c,title.$append)';
+}
+
+
+note "
+---
+".'add_field(title.$first, "first"); marc_spec(245,title.$append)     title: ["first", "Title / Name" ]';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -85,7 +108,9 @@ note 'add_field(title.$first, "first"); marc_spec(245,title.$append)     title:
     is_deeply $record->{title}, ['first', 'Title / Name'], 'marc_spec(245,title.$append)';
 }
 
-note 'marc_spec(245$a,title.$append)    title: [ "Title / " ]';
+note "
+---
+".'marc_spec(245$a,title.$append)    title: [ "Title / " ]';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -97,7 +122,9 @@ note 'marc_spec(245$a,title.$append)    title: [ "Title / " ]';
     is_deeply $record->{title}, ['Title / '], 'marc_spec(245$a.$append,title)';
 }
 
-note 'marc_spec(245,title, split:1)    title: [ "Title / ", "Name" ]';
+note "
+---
+".'marc_spec(245,title, split:1)    title: [ "Title / ", "Name" ]';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -110,7 +137,9 @@ note 'marc_spec(245,title, split:1)    title: [ "Title / ", "Name" ]';
         'marc_spec(245,title, split:1)';
 }
 
-note 'marc_spec(245,title.$append, split:1)    title: [ [ "Title / ", "Name" ] ]';
+note "
+---
+".'marc_spec(245,title.$append, split:1)    title: [ [ "Title / ", "Name" ] ]';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -122,7 +151,9 @@ note 'marc_spec(245,title.$append, split:1)    title: [ [ "Title / ", "Name" ] ]
     is_deeply $record->{title}, [[ 'Title / ', 'Name' ]], 'marc_spec(245a,title.$append,split:1)';
 }
 
-note 'marc_spec(245,title, split:1, nested_arrays:1)    title: [ [ "Title / ", "Name" ] ]';
+note "
+---
+".'marc_spec(245,title, split:1, nested_arrays:1)    title: [ [ "Title / ", "Name" ] ]';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -134,7 +165,9 @@ note 'marc_spec(245,title, split:1, nested_arrays:1)    title: [ [ "Title / ", "
     is_deeply $record->{title}, [[ 'Title / ', 'Name' ]], 'marc_spec(245, title, split:1, nested_arrays:1)';
 }
 
-note 'marc_spec(245,title.$append, split:1, nested_arrays:1)    title: [[ [ "Title / ", "Name" ] ]]';
+note "
+---
+".'marc_spec(245,title.$append, split:1, nested_arrays:1)    title: [[ [ "Title / ", "Name" ] ]]';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -146,7 +179,9 @@ note 'marc_spec(245,title.$append, split:1, nested_arrays:1)    title: [[ [ "Tit
     is_deeply $record->{title}, [[[ 'Title / ', 'Name' ]]], 'marc_spec(245a,title.$append,split:1, nested_arrays:1)';
 }
 
-note 'marc_spec(500,note)  note: "ABCD"';
+note "
+---
+".'marc_spec(500,note)  note: "ABCD"';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -158,7 +193,9 @@ note 'marc_spec(500,note)  note: "ABCD"';
     is_deeply $record->{note}, 'ABCD', 'marc_spec(500,note)';
 }
 
-note 'marc_spec(500$a,note)     note: "ABC"';
+note "
+---
+".'marc_spec(500$a,note)     note: "ABC"';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -170,7 +207,9 @@ note 'marc_spec(500$a,note)     note: "ABC"';
     is_deeply $record->{note}, 'ABC', 'marc_spec(500$a,note)';
 }
 
-note 'marc_spec(500$a,note, invert:1)     note: "D"';
+note "
+---
+".'marc_spec(500$a,note, invert:1)     note: "D"';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -182,7 +221,9 @@ note 'marc_spec(500$a,note, invert:1)     note: "D"';
     is_deeply $record->{note}, 'D', 'marc_spec(500$a,note,invert:1)';
 }
 
-note 'marc_spec(500,note.$append)  note: [ "ABCD" ]';
+note "
+---
+".'marc_spec(500,note.$append)  note: [ "ABCD" ]';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -194,7 +235,9 @@ note 'marc_spec(500,note.$append)  note: [ "ABCD" ]';
     is_deeply $record->{note}, ['ABCD'], ' marc_spec(500,note.$append)';
 }
 
-note 'marc_spec(500,note.$append, join:"#")  note: [ "A#B#C#D" ]';
+note "
+---
+".'marc_spec(500,note.$append, join:"#")  note: [ "A#B#C#D" ]';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -206,7 +249,9 @@ note 'marc_spec(500,note.$append, join:"#")  note: [ "A#B#C#D" ]';
     is_deeply $record->{note}, ['A#B#C#D'], ' marc_spec(500,note.$append, join:"#")';                                           
 }
 
-note 'marc_spec(500$a,note.$append)     note: [ "ABC" ]';
+note "
+---
+".'marc_spec(500$a,note.$append)     note: [ "ABC" ]';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -218,7 +263,9 @@ note 'marc_spec(500$a,note.$append)     note: [ "ABC" ]';
     is_deeply $record->{note}, ['ABC'], ' marc_spec(500$a,note.$append)';
 }
 
-note 'marc_spec(500$a,note.$append, invert:1)     note: [ "D" ]';
+note "
+---
+".'marc_spec(500$a,note.$append, invert:1)     note: [ "D" ]';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -230,7 +277,9 @@ note 'marc_spec(500$a,note.$append, invert:1)     note: [ "D" ]';
     is_deeply $record->{note}, ['D'], 'marc_spec(500$a,note.$append,invert:1)';
 }
 
-note 'marc_spec(500,note, split:1)     note: [ "A" , "B" , "C" , "D" ]';
+note "
+---
+".'marc_spec(500,note, split:1)     note: [ "A" , "B" , "C" , "D" ]';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -242,7 +291,9 @@ note 'marc_spec(500,note, split:1)     note: [ "A" , "B" , "C" , "D" ]';
     is_deeply $record->{note}, [ 'A', 'B', 'C', 'D' ], 'marc_spec(500,note, split:1)';
 }
 
-note 'marc_spec(500$x,note, split:1, invert:1)     note: [ "A" , "B" , "C"]';
+note "
+---
+".'marc_spec(500$x,note, split:1, invert:1)     note: [ "A" , "B" , "C"]';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -254,7 +305,9 @@ note 'marc_spec(500$x,note, split:1, invert:1)     note: [ "A" , "B" , "C"]';
     is_deeply $record->{note}, [ 'A', 'B', 'C' ], 'marc_spec(500$x,note, split:1, invert:1)';
 }
 
-note 'marc_spec(500$a,note, split:1)    note: [ "A" , "B" , "C" ]';
+note "
+---
+".'marc_spec(500$a,note, split:1)    note: [ "A" , "B" , "C" ]';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -279,7 +332,9 @@ note
     is_deeply $record->{note}, [[ "A" , "B" , "C" ]], 'marc_spec(500a,note, split:1)';
 }
 
-note 'marc_spec(500$a,note.$append, split:1)    note : [[ "A" , "B" , "C" ]]';
+note "
+---
+".'marc_spec(500$a,note.$append, split:1)    note : [[ "A" , "B" , "C" ]]';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -291,7 +346,9 @@ note 'marc_spec(500$a,note.$append, split:1)    note : [[ "A" , "B" , "C" ]]';
     is_deeply $record->{note}, [ [ 'A', 'B', 'C' ] ], 'marc_spec(500$a,note.$append, split:1)';
 }
 
-note 'marc_spec(500$x,note.$append, split:1, invert:1)    note : [[ "A" , "B" , "C" ]]';
+note "
+---
+".'marc_spec(500$x,note.$append, split:1, invert:1)    note : [[ "A" , "B" , "C" ]]';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -317,7 +374,9 @@ note
     is_deeply $record->{note}, [[[ "A" , "B" , "C" ]]], 'marc_spec(500$a,note.$append, split:1, nested_arrays: 1)';
 }
 
-note 'marc_spec(650,subject)   subject: "AlphaBetaGamma"';
+note "
+---
+".'marc_spec(650,subject)   subject: "AlphaBetaGamma"';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -329,7 +388,9 @@ note 'marc_spec(650,subject)   subject: "AlphaBetaGamma"';
     is_deeply $record->{subject}, 'AlphaBetaGamma', 'marc_spec(650,subject)';
 }
 
-note 'marc_spec(650$a,subject)  subject: "AlphaBetaGamma"';
+note "
+---
+".'marc_spec(650$a,subject)  subject: "AlphaBetaGamma"';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -341,7 +402,9 @@ note 'marc_spec(650$a,subject)  subject: "AlphaBetaGamma"';
     is_deeply $record->{subject}, 'AlphaBetaGamma', 'marc_spec(650$a,subject)';
 }
 
-note 'marc_spec(650[0]$a,subject)  subject: "Alpha"';
+note "
+---
+".'marc_spec(650[0]$a,subject)  subject: "Alpha"';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -353,7 +416,9 @@ note 'marc_spec(650[0]$a,subject)  subject: "Alpha"';
     is_deeply $record->{subject}, 'Alpha', 'marc_spec(650[0]$a,subject)';
 }
 
-note 'marc_spec(650$a/0,subject)  subject: "ABG"';
+note "
+---
+".'marc_spec(650$a/0,subject)  subject: "ABG"';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -365,7 +430,9 @@ note 'marc_spec(650$a/0,subject)  subject: "ABG"';
     is_deeply $record->{subject}, 'ABG', 'marc_spec(650$a/0,subject)';
 }
 
-note 'marc_spec(650$a/#,subject,invert:1)  subject: "AlphBetGamm"';
+note "
+---
+".'marc_spec(650$a/#,subject,invert:1)  subject: "AlphBetGamm"';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -377,7 +444,9 @@ note 'marc_spec(650$a/#,subject,invert:1)  subject: "AlphBetGamm"';
     is_deeply $record->{subject}, 'AlphBetGamm', 'marc_spec(650$a/#,subject,invert:1)';
 }
 
-note 'marc_spec(650$a,subject.$append)  subject: [ "Alpha", "Beta" , "Gamma" ]';
+note "
+---
+".'marc_spec(650$a,subject.$append)  subject: [ "Alpha", "Beta" , "Gamma" ]';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -444,7 +513,9 @@ note
     is_deeply $record->{subject}, [ ['Alpha'], ['Beta'], ['Gamma'] ], 'marc_spec(650$a,subject, split:1, nested_arrays:1)';
 }
 
-note 'marc_spec(999,local)     local: "XYZ"';
+note "
+---
+".'marc_spec(999,local)     local: "XYZ"';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -456,7 +527,9 @@ note 'marc_spec(999,local)     local: "XYZ"';
     is_deeply $record->{local}, 'XYZ', 'marc_spec(999,local)';
 }
 
-note 'marc_spec(999$a,local)    local: "XYZ"';
+note "
+---
+".'marc_spec(999$a,local)    local: "XYZ"';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -468,7 +541,9 @@ note 'marc_spec(999$a,local)    local: "XYZ"';
     is_deeply $record->{local}, 'XYZ', 'marc_spec(999$a,local)';
 }
 
-note 'marc_spec(999$a[0],local)    local: "XZ"';
+note "
+---
+".'marc_spec(999$a[0],local)    local: "XZ"';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -480,7 +555,9 @@ note 'marc_spec(999$a[0],local)    local: "XZ"';
     is_deeply $record->{local}, 'XZ', 'marc_spec(999$a[0],local)';
 }
 
-note 'marc_spec(999$a[#],local)    local: "YZ"';
+note "
+---
+".'marc_spec(999$a[#],local)    local: "YZ"';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -492,7 +569,9 @@ note 'marc_spec(999$a[#],local)    local: "YZ"';
     is_deeply $record->{local}, 'YZ', 'marc_spec(999$a[#],local)';
 }
 
-note 'marc_spec(999$a[#],local,invert:1)    local: "X"';
+note "
+---
+".'marc_spec(999$a[#],local,invert:1)    local: "X"';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -504,7 +583,9 @@ note 'marc_spec(999$a[#],local,invert:1)    local: "X"';
     is_deeply $record->{local}, 'X', 'marc_spec(999$a[#],local,invert:1)';
 }
 
-note 'marc_spec(999$a,local.$append)    local: [ "XY", "Z" ]';
+note "
+---
+".'marc_spec(999$a,local.$append)    local: [ "XY", "Z" ]';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -516,7 +597,9 @@ note 'marc_spec(999$a,local.$append)    local: [ "XY", "Z" ]';
     is_deeply $record->{local}, [ 'XY', 'Z' ], 'marc_spec(999$a,local.$append)';
 }
 
-note 'marc_spec(999$a[0],local.$append)    local: [ "X", "Z" ]';
+note "
+---
+".'marc_spec(999$a[0],local.$append)    local: [ "X", "Z" ]';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -528,7 +611,9 @@ note 'marc_spec(999$a[0],local.$append)    local: [ "X", "Z" ]';
     is_deeply $record->{local}, [ 'X', 'Z' ], 'marc_spec(999$a[0],local.$append)';
 }
 
-note 'marc_spec(999$a,local, split:1)   local: [ "X" , "Y", "Z" ]';
+note "
+---
+".'marc_spec(999$a,local, split:1)   local: [ "X" , "Y", "Z" ]';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -541,7 +626,9 @@ note 'marc_spec(999$a,local, split:1)   local: [ "X" , "Y", "Z" ]';
 }
 
 
-note 'marc_spec(999$a[0],local, split:1)   local: [ "X" , "Z" ]';
+note "
+---
+".'marc_spec(999$a[0],local, split:1)   local: [ "X" , "Z" ]';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -553,7 +640,9 @@ note 'marc_spec(999$a[0],local, split:1)   local: [ "X" , "Z" ]';
     is_deeply $record->{local}, [ 'X', 'Z' ], 'marc_spec(999$a[0],local, split:1)';
 }
 
-note 'marc_spec(999$a[0],local, split:1, invert:1)   local: [ "Y" ]';
+note "
+---
+".'marc_spec(999$a[0],local, split:1, invert:1)   local: [ "Y" ]';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -565,7 +654,9 @@ note 'marc_spec(999$a[0],local, split:1, invert:1)   local: [ "Y" ]';
     is_deeply $record->{local}, [ 'Y' ], 'marc_spec(999$a[0],local, split:1, invert:1)';
 }
 
-note 'marc_spec(999$a,local.$append, split:1)   local: [[ "X" , "Y", "Z" ]]';
+note "
+---
+".'marc_spec(999$a,local.$append, split:1)   local: [[ "X" , "Y", "Z" ]]';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -577,7 +668,9 @@ note 'marc_spec(999$a,local.$append, split:1)   local: [[ "X" , "Y", "Z" ]]';
     is_deeply $record->{local}, [ [ 'X', 'Y', 'Z' ] ], 'marc_spec(999$a,local.$append, split:1)';
 }
 
-note 'marc_spec(999$a[0],local.$append, split:1)   local: [[ "X" , "Z" ]]';
+note "
+---
+".'marc_spec(999$a[0],local.$append, split:1)   local: [[ "X" , "Z" ]]';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -590,7 +683,9 @@ note 'marc_spec(999$a[0],local.$append, split:1)   local: [[ "X" , "Z" ]]';
 }
 
 
-note 'marc_spec(999$a,local, nested_arrays:1)  local: [ ["X" , "Y"] , ["Z"] ]';
+note "
+---
+".'marc_spec(999$a,local, nested_arrays:1)  local: [ ["X" , "Y"] , ["Z"] ]';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -602,9 +697,23 @@ note 'marc_spec(999$a,local, nested_arrays:1)  local: [ ["X" , "Y"] , ["Z"] ]';
     is_deeply $record->{local}, [ [ 'X', 'Y' ], ['Z'] ], 'marc_spec(999$a,local, nested_arrays:1) ';
 }
 
+note "
+---
+".'marc_spec(999$a,local.$append, join:" ")     local: [ "X Y", "Z" ]';
+{
+    my $importer = Catmandu->importer(
+        'MARC',
+        file => \$mrc,
+        type => 'XML',
+        fix  => 'marc_spec(999$a,local.$append, join:" "); retain_field(local)'
+    );
+    my $record = $importer->first;
+    is_deeply $record->{local}, ['X Y', 'Z'], 'marc_spec(999$a,local.$append, join:" ")';
+}
 
-
-note 'marc_spec(...$a, all.$append)    all: [ "Title / ", "ABC", "Alpha", "Beta", "Gamma", "XY", "Z" ]';
+note "
+---
+".'marc_spec(...$a, all.$append)    all: [ "Title / ", "ABC", "Alpha", "Beta", "Gamma", "XY", "Z" ]';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -616,7 +725,9 @@ note 'marc_spec(...$a, all.$append)    all: [ "Title / ", "ABC", "Alpha", "Beta"
     is_deeply $record->{all}, [ "Title / ", "ABC", "Alpha", "Beta", "Gamma", "XY", "Z" ], 'marc_spec(...$a, all.$append)';
 }
 
-note 'marc_spec(..., all.$append)    all: [ "Title / Name", "ABCD", "Alpha", "Beta", "Gamma", "XY", "Z" ]';
+note "
+---
+".'marc_spec(..., all.$append)    all: [ "Title / Name", "ABCD", "Alpha", "Beta", "Gamma", "XY", "Z" ]';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -628,7 +739,9 @@ note 'marc_spec(..., all.$append)    all: [ "Title / Name", "ABCD", "Alpha", "Be
     is_deeply $record->{all}, [ "                        ", "Title / Name", "ABCD", "Alpha", "Beta", "Gamma", "XY", "Z" ], 'marc_spec(..., all.$append)';
 }
 
-note 'marc_spec(...$a, all, split:1)    all: [ "Title / " , "A" , "B" , "C", "Alpha" , "Beta" , "Gamma" , "X" , "Y", "Z" ]';
+note "
+---
+".'marc_spec(...$a, all, split:1)    all: [ "Title / " , "A" , "B" , "C", "Alpha" , "Beta" , "Gamma" , "X" , "Y", "Z" ]';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -640,7 +753,9 @@ note 'marc_spec(...$a, all, split:1)    all: [ "Title / " , "A" , "B" , "C", "Al
     is_deeply $record->{all}, [ "Title / " , "A" , "B" , "C", "Alpha" , "Beta" , "Gamma" , "X" , "Y", "Z" ], 'marc_spec(...$a, all, split:1)';
 }
 
-note 'marc_spec(...$a, all.$append, split:1)    all: [[ "Title / " , "A" , "B" , "C", "Alpha" , "Beta" , "Gamma" , "X" , "Y", "Z" ]]';
+note "
+---
+".'marc_spec(...$a, all.$append, split:1)    all: [[ "Title / " , "A" , "B" , "C", "Alpha" , "Beta" , "Gamma" , "X" , "Y", "Z" ]]';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -653,7 +768,9 @@ note 'marc_spec(...$a, all.$append, split:1)    all: [[ "Title / " , "A" , "B" ,
 }
 
     
-note 'marc_spec(...$a, all, split:1, nested_arrays:1)    all: [["Title / "], ["A" , "B" , "C"], ["Alpha"] , ["Beta"] , ["Gamma"] , ["X" , "Y"], ["Z"]]';
+note "
+---
+".'marc_spec(...$a, all, split:1, nested_arrays:1)    all: [["Title / "], ["A" , "B" , "C"], ["Alpha"] , ["Beta"] , ["Gamma"] , ["X" , "Y"], ["Z"]]';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -665,7 +782,9 @@ note 'marc_spec(...$a, all, split:1, nested_arrays:1)    all: [["Title / "], ["A
     is_deeply $record->{all}, [ ["Title / "], ["A" , "B" , "C"], ["Alpha"] , ["Beta"] , ["Gamma"] , ["X" , "Y"], ["Z"]], 'marc_spec(...$a, all, split:1, nested_arrays:1)';
 }
 
-note 'marc_spec(...$a, all.$append, split:1, nested_arrays:1)    all: [[ ["Title / "], ["A" , "B" , "C"], ["Alpha"] , ["Beta"] , ["Gamma"] , ["X" , "Y"], ["Z"]]]';
+note "
+---
+".'marc_spec(...$a, all.$append, split:1, nested_arrays:1)    all: [[ ["Title / "], ["A" , "B" , "C"], ["Alpha"] , ["Beta"] , ["Gamma"] , ["X" , "Y"], ["Z"]]]';
 {
     my $importer = Catmandu->importer(
         'MARC',
@@ -678,7 +797,9 @@ note 'marc_spec(...$a, all.$append, split:1, nested_arrays:1)    all: [[ ["Title
                                                            
 }
 
-note 'add_field(all.$first,"first"); marc_spec(...$a, all.$append, split:1, nested_arrays:1)    all: ["first",[ ["Title / "], ["A" , "B" , "C"], ["Alpha"] , ["Beta"] , ["Gamma"] , ["X" , "Y"], ["Z"]]]';
+note "
+---
+".'add_field(all.$first,"first"); marc_spec(...$a, all.$append, split:1, nested_arrays:1)    all: ["first",[ ["Title / "], ["A" , "B" , "C"], ["Alpha"] , ["Beta"] , ["Gamma"] , ["X" , "Y"], ["Z"]]]';
 {
     my $importer = Catmandu->importer(
         'MARC',

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libcatmandu-marc-perl.git



More information about the Pkg-perl-cvs-commits mailing list