+$config_path = "$abs_path/conf/marc.yml";
+
+ok(-e $config_path, "$config_path exists");
+
+ok(
+ $parser = new WebPAC::Parser(
+ config => new WebPAC::Config( path => $config_path ),
+ base_path => $abs_path,
+ %LOG,
+), "new");
+
+ok(my $marc = $parser->have_rules('marc', 'marc', 'marc-input'), 'have_rules(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_*');
+
+
+$config_path = "$abs_path/conf/sub.yml";
+
+ok(-e $config_path, "$config_path exists");
+
+ok(
+ $parser = new WebPAC::Parser(
+ config => new WebPAC::Config( path => $config_path ),
+ base_path => $abs_path,
+ %LOG,
+), "new");
+
+ok(my $rules = $parser->normalize_rules('sub','sub-input'), "normalize_rules(sub)");
+
+diag "rules: $rules" if $debug;
+
+our @test;
+eval $rules;
+diag "test = ",dump( @test ) if $debug;
+
+ok(! $@, "eval: $@" );
+
+is_deeply( [ @test ], [ "foo", "foo", "bar >>2<<", "bar >>42<<", 1,2,3 ], 'source fixed' );
+