/[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 692 by dpavlin, Sun Sep 24 21:13:40 2006 UTC revision 703 by dpavlin, Mon Sep 25 13:24:09 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 => 20;  use Test::More tests => 26;
5  use Test::Exception;  use Test::Exception;
6  use blib;  use blib;
7    
# Line 55  diag "_lookup_create = ",dump($l); Line 55  diag "_lookup_create = ",dump($l);
55  ok(my $n = $parser->{_normalize_source}, "_normalize_source");  ok(my $n = $parser->{_normalize_source}, "_normalize_source");
56  diag "_normalize_source = ",dump($n);  diag "_normalize_source = ",dump($n);
57    
58    ok(my $d = $parser->{depends}, "depends");
59    diag "depends = ",dump($d);
60    
61    my $expected_depend = {
62       foo => {
63                "foo-input1" => {
64                                  bar => { "bar-input" => { "200-a-200-e" => 1 } },
65                                  baz => { "baz-input" => { "200-a" => 1 } },
66                                  foo => { "foo-input1" => { 11 => 1 }, "foo-input2" => { 11 => 1 } },
67                                },
68                "foo-input2" => {
69                                  bar => { "bar-input" => { "900-x" => 1 } },
70                                  baz => { "baz-input" => { "900-x" => 1 } },
71                                  foo => { "foo-input1" => { "245-a" => 1 }, "foo-input2" => { "245-a" => 1 } },
72                                },
73              },
74       bar => {
75                "bar-input" => {
76                      baz => { "baz-input" => { "900-x" => 1 } },
77                      foo => { "foo-input1" => { "245-a" => 1 } },
78                    },
79              },
80       baz => {
81                "baz-input" => {
82                      bar => { "bar-input" => { "900-x" => 1 } },
83                      foo => { "foo-input2" => { "245-a" => 1 } },
84                    },
85              },
86    };
87    
88    
89    is_deeply($d, $expected_depend, "depends correct");
90    
91    foreach my $db (keys %$d) {
92            foreach my $i (keys %{$d->{$db}}) {
93                    is_deeply($d->{$db}->{$i}, $parser->depends($db,$i), "depend $db/$i");
94            }
95    }

Legend:
Removed from v.692  
changed lines
  Added in v.703

  ViewVC Help
Powered by ViewVC 1.1.26