I'm trying to use Test::More and Test::Deep to compare two complex data structures (nested objects). Ideally, I would use cmp_deeply and pass it both data structures, but do a lower (or upper) case on all the values so the comparison would be case insensitive. Something like
return cmp_deeply( lc($Expected)
, lc($AcTuaL)
, "This is my case insensitive comparison"
);
Am I missing something obvious here? I don't want to change the actual data in the structures. I also don't want to just stringify it because I want the diagnostics that come with Test::More to show what values actually fail.
Ideas?
-
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.
|