Re: Fwd: Multiple comp_root bug (extra ARG)

Marius Feraru <[email protected]> Mon, 05 Dec 2005 13:23:02 +0200
Newsgroups gmane.comp.web.mason.devel
Organization N0i.Net
Message-ID <[email protected]>
Dave Rolsky wrote:
> Is this something that only happens under mod_perl?
Did I forgot to mention that? Sorry. Yes, only under mod_perl :(
I assume more, it will happen only if using libapreq (vs CGI), but 
that's just an assumption for the moment.

> If you could create a test that exercises this under the Mason test 
> framework that'd be ideal. 
Hmm, IIRC live testing it's dead... or at least I haven't seen it 
working for a loooooooong time :)

OK, for conformity I attached a patch against t/07-interp.t but, as i 
said, it's useless :(

Next step, I'll try baking some standalone test under mod_perl.

-- 
Marius Feraru
multi_comp_root_args_test.patch (text/x-patch, 1.7 KB)
--- t/07-interp.t.orig	2005-12-05 11:28:32.000000000 +0200
+++ t/07-interp.t	2005-12-05 13:13:10.000000000 +0200
@@ -918,5 +918,48 @@
 EOF
                     );
 
+
+#------------------------------------------------------------
+
+    my $echo_comp = << 'EOF';
+<%flags>
+	inherit => undef
+</%flags>
+<%once>
+	use Data::Dumper ();
+</%once>
+<%init>
+  local $Data::Dumper::Indent = 0;
+  local $Data::Dumper::Sortkeys = 1;
+  local $Data::Dumper::Terse = 1;
+
+  $m->clear_buffer;
+#  $r->content_type('text/plain; charset=UTF-8');
+  $m->print(Data::Dumper::Dumper(\%ARGS));
+  $m->abort;
+</%init>
+EOF
+
+    my $echo_comps = [
+        # call_path, comp_path, id, description
+        [ '/echo_private', HTML::Mason::Tests->tests_class->comp_root, 'A', 'primary comp_root'],
+        [ '/echo_shared',  $alt_root, 'B', 'secondary comp_root - comp in top directory' ],
+        [ '/shared_subdir/echo_shared', File::Spec->catdir( $alt_root, 'shared_subdir' ), 'C', 'secondary comp_root - comp in subdirectory' ],
+    ];
+
+    foreach my $ec (@$echo_comps) {
+        (my $basename = $ec->[0]) =~ s{^.*/}{}; # lazy basename ;-)
+        HTML::Mason::Tests->tests_class->write_comp( $ec->[0], $ec->[1], $basename, $echo_comp );
+        $group->add_test( name => 'multi_comp_root_args_' . $ec->[2],
+                      description => $ec->[2] . ') ' . $ec->[3],
+                      call_path => '/comp_root_test/multi_comp_root_args_' . $ec->[2],
+                      interp_params => { comp_root => \@roots },
+                      component => '<& ' . $ec->[0] . ', a => 1, b => 2 &>',
+                      expect => q{{'a' => 1,'b' => 2}},
+                    );
+    }
+
+#------------------------------------------------------------
+
     return $group;
 }
smime.p7s (application/x-pkcs7-signature, 3.1 KB) - not displayed