ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/Utilities/TestClass.pm
(Generate patch)

Comparing COMP/SCRAM/src/Utilities/TestClass.pm (file contents):
Revision 1.9 by williamc, Thu Mar 2 16:40:24 2000 UTC vs.
Revision 1.10 by williamc, Mon Aug 28 08:35:16 2000 UTC

# Line 21 | Line 21
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;
# Line 81 | Line 83 | sub dotest {
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;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines