/[webpac2]/trunk/t/1-lookup.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/1-lookup.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4 - (hide annotations)
Sat Jul 16 12:37:18 2005 UTC (18 years, 10 months ago) by dpavlin
Original Path: trunk/t/01-lookup.t
File MIME type: application/x-troff
File size: 666 byte(s)
more work on lookups, example configuration layout

1 dpavlin 3 #!/usr/bin/perl -w
2    
3 dpavlin 4 use strict;
4     use Test::More tests => 6;
5 dpavlin 3 use Test::Exception;
6     use blib;
7    
8 dpavlin 4 use Data::Dumper;
9    
10 dpavlin 3 BEGIN {
11 dpavlin 4 use_ok( 'WebPAC::Lookup' );
12 dpavlin 3 }
13    
14 dpavlin 4 throws_ok { new WebPAC::Lookup() } qr/lookup_file/, "new without lookup_file";
15 dpavlin 3
16 dpavlin 4 ok(my $lookup = new WebPAC::Lookup( lookup_file => 'conf/lookup/example.pm' ), "new");
17    
18     my $rec = {
19     '000' => [ '001' ],
20     '800' => [ 'foo' ],
21     '900' => [ 'bar' ],
22     };
23    
24     ok($lookup->add( $rec ), "add");
25    
26     print Dumper($lookup);
27    
28     ok($lookup->{'lookup'}, "have lookup hash");
29    
30     my $lookup_res = {
31     '800:foo' => [ 'bar' ],
32     '000:001' => [ '001' ],
33     '900:bar' => [ 'foo', 'foo' ]
34     };
35    
36     is_deeply($lookup_res, $lookup->{'lookup'}, "lookup data");
37    

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26