~ubuntu-branches/ubuntu/lucid/libhtml-widgets-navmenu-perl/lucid

« back to all changes in this revision

Viewing changes to HTML/Widgets/NavMenu/Test/Util.pm

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Yu, Jonathan Yu, Ryan Niebur, gregor herrmann
  • Date: 2009-12-09 18:35:53 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20091209183553-5ud0ofdv4ek4e6i3
Tags: 1.0400-1
[ Jonathan Yu ]
* New upstream release
* Add myself to Uploaders and Copyright
* Remove liberror-perl dependency (no longer required upstream)
* Refresh copyright to DEP5 proposed format

[ Ryan Niebur ]
* Update ryan52's email address

[ gregor herrmann ]
* debian/copyright: update years of upstream copyright.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
package HTML::Widgets::NavMenu::Test::Util;
2
 
 
3
 
use strict;
4
 
use warnings;
5
 
 
6
 
use Exporter;
7
 
use vars qw(@ISA);
8
 
@ISA=qw(Exporter);
9
 
 
10
 
use vars qw(@EXPORT);
11
 
 
12
 
@EXPORT = qw(compare_string_arrays);
13
 
 
14
 
sub compare_string_arrays
15
 
{
16
 
    my $arr1 = shift;
17
 
    my $arr2 = shift;
18
 
    my $len_cmp = (@$arr1 <=> @$arr2);
19
 
    if ($len_cmp)
20
 
    {
21
 
        print STDERR "Len is not the same: Expected " . scalar(@$arr1) . " vs. Result " . scalar(@$arr2) . "\n";
22
 
        return $len_cmp;
23
 
    }
24
 
    my $i;
25
 
    for($i=0;$i<@$arr1;$i++)
26
 
    {
27
 
        my $item_cmp = $arr1->[$i] cmp $arr2->[$i];
28
 
        if ($item_cmp)
29
 
        {
30
 
            print STDERR "Item[$i] is not the same:\nExpected: $arr1->[$i]\nResult: $arr2->[$i]\n";
31
 
            return $item_cmp;
32
 
        }
33
 
    }
34
 
    return 0;
35
 
}
36
 
 
37
 
1;