/[webpac2]/trunk/t/3-normalize-xml.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/t/3-normalize-xml.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 15 - (hide annotations)
Sun Jul 17 10:42:23 2005 UTC (18 years, 9 months ago) by dpavlin
File MIME type: application/x-troff
File size: 841 byte(s)
WebPAC::Common cleanup, most code moved to WebPAC::Normalize. Added
documentation about order of data mungling when normalising data.

1 dpavlin 12 #!/usr/bin/perl -w
2    
3 dpavlin 13 use Test::More tests => 8;
4 dpavlin 12 use Test::Exception;
5     use Cwd qw/abs_path/;
6     use blib;
7     use strict;
8    
9     BEGIN {
10     use_ok( 'WebPAC::Normalize::XML' );
11     }
12    
13     ok(my $abs_path = abs_path($0), "abs_path");
14     $abs_path =~ s#/[^/]*$#/#;
15     diag "abs_path: $abs_path";
16    
17 dpavlin 15 ok(my $n = new WebPAC::Normalize::XML( debug => 0 ), "new");
18 dpavlin 13
19     throws_ok { $n->open() } qr/tag/, "open without tag";
20     throws_ok { $n->open( tag => 'isis' ) } qr/xml_file/, "open without xml_file";
21     throws_ok { $n->open( tag => 'isis', xml_file => 'foo' ) } qr/file.*doesn't exist/, "open with invalid xml_file";
22     ok( $n->open(
23 dpavlin 12 tag => 'isis',
24     xml_file => "$abs_path../conf/normalize/isis.xml",
25 dpavlin 13 ), "open");
26 dpavlin 12
27 dpavlin 13 my $rec = {
28     '000' => [ '001' ],
29     '800' => [ 'foo' ],
30     '900' => [ 'bar' ],
31     };
32 dpavlin 12
33 dpavlin 13 ok(my @ds = $n->data_structure( $rec ), "data_structure");
34    
35     use Data::Dumper;
36     diag Dumper(\@ds);

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26