/[webpac2]/trunk/t/2-parse.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

Diff of /trunk/t/2-parse.t

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 705 by dpavlin, Mon Sep 25 13:46:36 2006 UTC revision 706 by dpavlin, Mon Sep 25 14:06:49 2006 UTC
# Line 1  Line 1 
1  #!/usr/bin/perl -w  #!/usr/bin/perl -w
2    
3  use strict;  use strict;
4  use Test::More tests => 36;  use Test::More tests => 43;
5  use Test::Exception;  use Test::Exception;
6  use blib;  use blib;
7    
# Line 49  foreach my $db (keys %$inputs) { Line 49  foreach my $db (keys %$inputs) {
49  ok(! $parser->valid_database('non-existant'), "no database");  ok(! $parser->valid_database('non-existant'), "no database");
50  ok(! $parser->valid_database_input('foo','non-existant'), "no database input");  ok(! $parser->valid_database_input('foo','non-existant'), "no database input");
51    
52  ok(my $l = $parser->{_lookup_create}, "_lookup_create");  ok(my $l = $parser->{_lookup_create_key}, "_lookup_create_key");
53  diag "_lookup_create = ",dump($l) if ($debug);  ok($parser->{_lookup_create}, "_lookup_create");
54    diag "_lookup_create_key = ",dump($l) if ($debug);
55  foreach my $db (keys %$l) {  foreach my $db (keys %$l) {
56          foreach my $i (keys %{$l->{$db}}) {          foreach my $i (keys %{$l->{$db}}) {
57                  foreach my $k (keys %{$l->{$db}->{$i}}) {                  ok(defined($parser->lookup_create_rules($db,$i)), "have $db/$i");
58                          ok(defined($parser->lookup_create_rules($db,$i)->{$k}), "have $db/$i/$k");                  my @keys = sort keys %{$l->{$db}->{$i}};
59                  }                  ok(@keys, 'have keys');
60                    my @have_keys = sort $parser->have_lookup_create($db,$i);
61                    ok(@have_keys, 'have_lookup_create');
62                    ok(eq_array(\@have_keys, \@keys), "found all lookups");
63          }          }
64  }  }
65    

Legend:
Removed from v.705  
changed lines
  Added in v.706

  ViewVC Help
Powered by ViewVC 1.1.26