Thanks for the reply...
Your subtest is simply an anonymous routine which does not take any parameters. To properly illustrate what I wanted perhaps the code below will clarify....
my $xml;
sub my_subtest {
like( $xml, qr/xml version=/, "XML Document");
# more tests on XML document text here....
}
$xml = MyPackage::method1();
subtest 'Checking XML from method1' => \&my_subtest;
$xml = MyPackage::method2();
subtest 'Checking XML from method2...' => \&my_subtest;
I would like to pass $xml as a variable (plus other test parameters) to the subtest. I think the original fudge poster was close as it looks as though having a "fudge wrapper" is the only way this can be achieved. I did wonder if there was a more direct method or whether subtest passed on additional params to "my_subtest".
If any of my proposed solutions have minor errors, it's because I don't waste my genius on trivial matters. :-P
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|