My first comment is that tests should be as dumb as possible. This also translates to as superficial and verbose as possible. For example, the use of map in the is_deeply tells me that this should probably be unrolled into a series of is. The reason for this is for ease of test maintenace. Tests are also excellent synopses of what they're testing. I often look at tests to see exactly how the module I want to use is intended to function and some clues on how it operates internally. In other words, tests can be used for additional and indepth documentation for the author and users a like.
Another couple of things: that you don't have to use done_testing and set tests => "14";. If you unroll the is_deeply and base the number of tests on the number of entries in your input files, then go with just the done_testing. This is most useful when the number of tests are based on input length that you may update at some point. Finally, I don't see anything on an initial pass that requires you include use v5.10.0;.
Overall, I think it's great. And it's even greater that you're actually writing a test! :)
-
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.
|