From 15c4389c7b76b14116d76e2f0f5210e3dd6f0b2f Mon Sep 17 00:00:00 2001 From: Jakob Voss Date: Tue, 28 Sep 2021 08:52:45 +0200 Subject: [PATCH] Test matching blank indicator (#107) --- t/match-blank-indicator.t | 41 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 t/match-blank-indicator.t 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;