Subject: | test failures with HTML::Mason 1.36 |
Hi,
MasonX-Interp-WithCallbacks currently fails two tests in t/09cgi.t on
Debian unstable due to a change in HTML::Mason 1.36. This is Debian bug
#434445, http://bugs.debian.org/434445 . Quoting myself from there:
[from HTML::Mason changelog]
- Request::CGIHandler->exec() now returns the return value from
executing the component, just like a normal Request. Reported by
Adrian Irving-Beer.
This also changes the return code from
HTML::Mason::CGIHandler->handle_request() for two of the
test cases. Before HTML::Mason 1.36, it happened to be 1 from
HTML::Mason::FakeApache::send_http_header(). Now the return code is
'undef', because t/htdocs/dhandler does not have an explicit 'return'
statement [1].
The suggested fix is to add an explicit 'return 200' (ie. HTTP OK)
into t/htdocs/dhandler. This keeps the tests compatible with both the
old and the new HTML::Mason versions (on 1.35, send_http_header() turns
200 into 1, ie. still true.) Trivial patch attached.
[1] The actual code that gets eval()'d from the component is generated
by HTML::Mason::Compiler::ToObject, which puts an explicit void
'return;' at the end (see the _body() routine) and thus always returns
'undef'.
Thanks for your work on MasonX-Interp-WithCallbacks,
--
Niko Tyni (on behalf of the Debian Perl Group)
ntyni@iki.fi
Subject: | dhandler.patch |
--- libmasonx-interp-withcallbacks-perl-1.16/t/htdocs/dhandler 2007/07/23 21:40:48 1.1
+++ libmasonx-interp-withcallbacks-perl-1.16/t/htdocs/dhandler 2007/07/23 21:40:55
@@ -1 +1,2 @@
% $m->print(ref $ARGS{result} ? $ARGS{result}->($m) : $ARGS{result});
+% return 200;