r1067@llin: dpavlin | 2006-10-05 16:35:45 +0200
[webpac2] / t / 2-parse.t
index 7589e5a..10e677f 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 
 use strict;
-use Test::More tests => 51;
+use Test::More tests => 55;
 use Test::Exception;
 use blib;
 
@@ -112,3 +112,29 @@ foreach my $db (keys %$d) {
        }
 }
 
+$config_path = "$abs_path/conf/marc.yml";
+
+ok(-e $config_path, "$config_path exists");
+
+ok(
+       my $parser = new WebPAC::Parser(
+               config => new WebPAC::Config( path => $config_path ),
+               base_path => $abs_path,
+               debug => $debug,
+), "new");
+
+ok(my $marc = $parser->generate_marc('marc','marc-input'), 'generate_marc');
+
+diag "marc: ",dump($marc) if ($debug);
+
+is_deeply($marc, {
+       marc                                            => 1,
+       marc_compose                            => 1,
+       marc_duplicate                          => 1,
+       marc_indicators                         => 1,
+       marc_leader                                     => 1,
+       marc_original_order                     => 1,
+       marc_remove                                     => 1,
+       marc_repeatable_subfield        => 1,
+}, 'catched all marc_*');
+