3 use Test::More tests => 10;
10 use_ok( 'WebPAC::Normalize::XML' );
13 ok(my $abs_path = abs_path($0), "abs_path");
14 $abs_path =~ s#/[^/]*$#/#;
15 diag "abs_path: $abs_path";
17 throws_ok { new WebPAC::Normalize::XML( lookup_regex => 'foo' ) } qr/pair/, "lookup_regex without lookup";
18 throws_ok { new WebPAC::Normalize::XML( lookup => 'bar' ) } qr/pair/, "lookup without lookup_regex";
20 ok(my $n = new WebPAC::Normalize::XML( debug => 0 ), "new");
22 throws_ok { $n->open() } qr/tag/, "open without tag";
23 throws_ok { $n->open( tag => 'isis' ) } qr/xml_file/, "open without xml_file";
24 throws_ok { $n->open( tag => 'isis', xml_file => 'foo' ) } qr/file.*doesn't exist/, "open with invalid xml_file";
27 xml_file => "$abs_path../conf/normalize/isis.xml",
36 ok(my @ds = $n->data_structure( $rec ), "data_structure");