Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I just inherited some code that uses Test::Harness::Straps across a variety of platforms. I discovered that I have two different versions of Straps.pm (on two different platforms), but both of them are labeled 0.26.

The biggest difference that I noticed is that the analyze function returns a hash in one version, and returns a reference in the other version.

I was unable to find the change history online for specifically Test::Harness::Straps (I looked in the Test::Harness package change history, but it did not help). Below I have attached the top 20 or so lines from each file, down to the point where you can see that analyze returns a hash for one, and a reference for the other. It appears that the latter is the newer form, as that is what I see on CPAN.

Can anyone enlighten me on this? Rather than upgrading some of the older systems, I am about to put in code that treats the return value differently depending on if it is a reference. But before doing so, I would like to understand why I have different versions on two different systems (with the same version of perl), and why they have the same version number. Thanks!
RHEL 3 - x86 [root@vdt-fc3-ia32 tests]# perl -v This is perl, v5.8.5 built for i386-linux-thread-multi Straps.pm: # -*- Mode: cperl; cperl-indent-level: 4 -*- package Test::Harness::Straps; use strict; use vars qw($VERSION); $VERSION = '0.26'; use Config; use Test::Harness::Assert; use Test::Harness::Iterator; use Test::Harness::Point; # Flags used as return values from our methods. Just for internal # clarification. my $YES = (1==1); my $NO = !$YES; =head1 NAME Test::Harness::Straps - detailed analysis of test results =head1 SYNOPSIS use Test::Harness::Straps; my $strap = Test::Harness::Straps->new; # Various ways to interpret a test my %results = $strap->analyze($name, \@test_output); my %results = $strap->analyze_fh($name, $test_filehandle); my %results = $strap->analyze_file($test_file);

And the other system:
RHEL 4 - x86 [root@vdt-rhas4-ia32 tests]# perl -v This is perl, v5.8.5 built for i386-linux-thread-multi Straps.pm: # -*- Mode: cperl; cperl-indent-level: 4 -*- package Test::Harness::Straps; use strict; use vars qw($VERSION); $VERSION = '0.26'; use Config; use Test::Harness::Assert; use Test::Harness::Iterator; use Test::Harness::Point; use Test::Harness::Results; # Flags used as return values from our methods. Just for internal # clarification. my $YES = (1==1); my $NO = !$YES; =head1 NAME Test::Harness::Straps - detailed analysis of test results =head1 SYNOPSIS use Test::Harness::Straps; my $strap = Test::Harness::Straps->new; # Various ways to interpret a test my $results = $strap->analyze($name, \@test_output); my $results = $strap->analyze_fh($name, $test_filehandle); my $results = $strap->analyze_file($test_file);

In reply to Test::Harness::Straps->anaylze() return value change by swkronenfeld

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • 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 or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2022-09-28 22:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer my indexes to start at:




    Results (125 votes). Check out past polls.

    Notices?