Subject: | Broken test (too specific regexp) |
Excellent work!
But the tests don't pass. Don't know exactly what was expected, but this is the result of the breaking 04trace.t running on "This is perl, v5.8.6 built for MSWin32-x86-multi-thread". Perhaps the error output differs between Perl versions or something?
C:\.cpan\build\Catalyst-Plugin-StackTrace-0.01>prove -v -I lib t\04trace.t
t\04trace....1..7
ok 1 - request ok
ok 2 - response ok
ok 3 - request ok
not ok 4 - error ok
# Failed test (t\04trace.t at line 24)
# '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
# "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
# <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
# <head>
# <meta http-equiv="Content-Language" content="en" />
# <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
# <title>TestApp on Catalyst 5.61</title>
# <script type="text/javascript">
# <!--
# function toggleDump (dumpElement) {
# var e = document.getElementById( dumpElement );
# if (e.style.display == "none") {
# e.style.display = "";
# }
# else {
# e.style.display = "none";
# }
# }
# -->
# </script>
# <style type="text/css">
# body {
# font-family: "Bitstream Vera Sans", "Trebuchet MS", Verdana,
# Tahoma, Arial, helvetica, sans-serif;
# color: #ddd;
# background-color: #eee;
# margin: 0px;
# padding: 0px;
# }
# :link, :link:hover, :visited, :visited:hover {
# color: #ddd;
# }
# div.box {
# position: relative;
# background-color: #ccc;
# border: 1px solid #aaa;
# padding: 4px;
# margin: 10px;
# -moz-border-radius: 10px;
# }
# div.error {
# background-color: #977;
# border: 1px solid #755;
# padding: 8px;
# margin: 4px;
# margin-bottom: 10px;
# -moz-border-radius: 10px;
# }
# div.infos {
# background-color: #797;
# border: 1px solid #575;
# padding: 8px;
# margin: 4px;
# margin-bottom: 10px;
# -moz-border-radius: 10px;
# }
# div.name {
# background-color: #779;
# border: 1px solid #557;
# padding: 8px;
# margin: 4px;
# -moz-border-radius: 10px;
# }
# code.error {
# display: block;
# margin: 1em 0;
# overflow: auto;
# }
# div.name h1, div.error p {
# margin: 0;
# }
# h2 {
# margin-top: 0;
# margin-bottom: 10px;
# font-size: medium;
# font-weight: bold;
# text-decoration: underline;
# }
# h1 {
# font-size: medium;
# font-weight: normal;
# }
# </style>
# </head>
# <body>
# <div class="box">
# <div class="error"><pre><p><code class="error">Caught exception "Undefined subroutine &TestApp::Controller::Foo::three called at C:/.cp
/TestApp/Controller/Foo.pm line 22."</code></p></pre></div>
#
# <style type="text/css">
# div.trace {
# background-color: #5f7e7e;
# }
# th, td {
# padding-right: 1.5em;
# text-align: left;
# }
# </style>
# <div class="trace error">
# <h2><a href="#" onclick="toggleDump('stacktrace'); return false">Stack Trace</a></h2>
# <div id="stacktrace">
# <table>
# <tr>
# <th>Package</th>
# <th>Line </th>
# <th>File </th>
# </tr>
#
# <tr>
# <td>TestApp::Controller::Foo</td>
# <td>22</td>
# <td>C:/.cpan/build/Catalyst-Plugin-StackTrace-0.01/t/lib/TestApp/Controller/Foo.pm</td>
# </tr>
# <tr>
# <td colspan="3"><pre><p><code class="error"> 19: sub crash : Local {
# 20: my ( $self, $c ) = @_;
# 21:
# <b> 22: three();
# </b> 23: }
# 24:
# 25: 1;
# </code></p></pre></td>
# </tr>
#
# <tr>
# <td>TestApp::Controller::Foo</td>
# <td>16</td>
# <td>C:/.cpan/build/Catalyst-Plugin-StackTrace-0.01/t/lib/TestApp/Controller/Foo.pm</td>
# </tr>
# <tr>
# <td colspan="3"><pre><p><code class="error"> 13: sub not_ok : Local {
# 14: my ( $self, $c ) = @_;
# 15:
# <b> 16: $c->forward( 'crash' );
# </b> 17: }
# 18:
# 19: sub crash : Local {
# </code></p></pre></td>
# </tr>
#
# </table>
# </div>
# </div>
# <div class="infos"><h2><a href="#" onclick="toggleDump('dump_0'); return false">Request</a></h2>
# <div id="dump_0">
# <pre>bless( {
# 'protocol' => 'HTTP/1.1',
# 'headers' => bless( {
# 'https' => 'OFF',
# 'host' => 'localhost:80'
# }, 'HTTP::Headers' ),
# 'snippets' => [],
# 'body_parameters' => {},
# 'secure' => 0,
# 'hostname' => 'localhost',
# 'uploads' => {},
# 'user' => undef,
# 'method' => 'GET',
# 'address' => '127.0.0.1',
# 'base' => bless( do{\(my $o = 'http://localhost/')}, 'URI::http' ),
# 'cookies' => {},
# 'match' => 'foo/not_ok',
# 'path' => 'foo/not_ok',
# 'uri' => bless( do{\(my $o = 'http://localhost/foo/not_ok')}, 'URI::http' ),
# 'query_parameters' => {},
# 'parameters' => {},
# 'action' => 'foo/not_ok',
# 'arguments' => []
# }, 'Catalyst::Request' )
# </pre>
# </div>
#
# <h2><a href="#" onclick="toggleDump('dump_1'); return false">Response</a></h2>
# <div id="dump_1">
# <pre>bless( {
# 'body' => '',
# 'cookies' => {},
# 'headers' => bless( {
# 'content-type' => 'text/html; charset=utf-8',
# 'x-catalyst' => '5.61'
# }, 'HTTP::Headers' ),
# 'status' => 200
# }, 'Catalyst::Response' )
# </pre>
# </div>
#
# <h2><a href="#" onclick="toggleDump('dump_2'); return false">Stash</a></h2>
# <div id="dump_2">
# <pre>{}
# </pre>
# </div>
# </div>
# <div class="name"><h1>TestApp on Catalyst 5.61</h1></div>
# </div>
# </body>
# </html>
# '
# doesn't match '(?-xism:Caught exception in TestApp::Controller::Foo)'
ok 5 - trace ok
ok 6 - line number ok
# Looks like you failed 1 test of 7.
ok 7 - context ok
dubious
Test returned status 1 (wstat 256, 0x100)
DIED. FAILED test 4
Failed 1/7 tests, 85.71% okay
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t\04trace.t 1 256 7 1 14.29% 4
Failed 1/1 test scripts, 0.00% okay. 1/7 subtests failed, 85.71% okay.
As you can see, the "Caught exception" doesn't look exactly like the regexp when I run it.
/J