21 |
|
# expect(string) : tell the testinterface of any expected return values |
22 |
|
# clearexpect() : Reset any expect variables. |
23 |
|
#cleantemp() : delete the temporary area |
24 |
+ |
# cmparray(arrayref, @reqvals) : test the arrayref against expected |
25 |
+ |
# cmpstring(expectedstring,actualstring) : |
26 |
|
|
27 |
|
package Utilities::TestClass; |
28 |
|
require 5.004; |
83 |
|
$self->{testobj}->checktests(); |
84 |
|
} |
85 |
|
|
86 |
+ |
sub cmparray { |
87 |
+ |
my $self=shift; |
88 |
+ |
my $array=shift; |
89 |
+ |
my @vals=@_; |
90 |
+ |
|
91 |
+ |
if ( $#{$array} ne $#vals) { $self->testfail( |
92 |
+ |
$#{$array}." items retuned, $#vals expected"); |
93 |
+ |
} |
94 |
+ |
else { |
95 |
+ |
for( my $i=0; $i<= $#{$array}; $i++) { |
96 |
+ |
$self->cmpstring($vals[$i],$$array[$i]); |
97 |
+ |
} |
98 |
+ |
} |
99 |
+ |
} |
100 |
+ |
|
101 |
|
|
102 |
|
sub cmpstring { |
103 |
|
my $self=shift; |