diff --git a/t/match-blank-indicator.t b/t/match-blank-indicator.t new file mode 100644 index 0000000..21153f7 --- /dev/null +++ b/t/match-blank-indicator.t @@ -0,0 +1,41 @@ +#!perl + +use strict; +use warnings; +use Test::More; +use Catmandu qw(importer); + +my $mrc = <<'MRC'; + + + + + __ + + + 1_ + + + _1 + + + +MRC + +my $fix = <<'FIX'; +marc_map("003[,]",test.0) +marc_map("003[ ,]",test.1) +marc_map("003[, ]",test.2) +marc_map("003[ , ]",test.3) +retain_field(test) +FIX + +my $importer = importer( 'MARC', file => \$mrc, type => 'XML', fix => $fix ); +my $record = $importer->first; +note explain $record; + +is_deeply $record->{test}, + [ [ "__", "1_", "_1" ], [ "__", "_1" ], [ "__", "1_" ], ["__"] ], + "match blank indicators"; + +done_testing;