Lines Matching refs:got
136 my ($got, $expected, $name, @mess) = @_;
139 if( !defined $got || !defined $expected ) {
141 $pass = !defined $got && !defined $expected;
144 $pass = $got eq $expected;
148 unshift(@mess, "# got "._q($got)."\n",
155 my ($got, $isnt, $name, @mess) = @_;
158 if( !defined $got || !defined $isnt ) {
160 $pass = defined $got || defined $isnt;
163 $pass = $got ne $isnt;
167 unshift(@mess, "# it should not be "._q($got)."\n",
174 my($got, $type, $expected, $name, @mess) = @_;
181 $pass = eval "\$got $type \$expected";
191 if ($got eq $expected and $type !~ tr/a-z//) {
192 unshift @mess, "# $got - $expected = " . ($got - $expected) . "\n";
194 unshift(@mess, "# got "._q($got)."\n",
200 # Check that $got is within $range of $expected
207 my ($got, $expected, $range, $name, @mess) = @_;
209 if (!defined $got or !defined $expected or !defined $range) {
211 } elsif ($got !~ tr/0-9// or $expected !~ tr/0-9// or $range !~ tr/0-9//) {
213 unshift @mess, "# got, expected and range must be numeric\n";
219 $pass = $got == $expected;
222 $pass = ($got <= $range) && ($got >= - $range);
224 my $diff = $got - $expected;
228 if ($got eq $expected) {
229 unshift @mess, "# $got - $expected = " . ($got - $expected) . "\n";
231 unshift@mess, "# got "._q($got)."\n",
239 my ($got, $expected, $name, @mess) = @_;
242 $pass = $got =~ $expected;
244 unshift(@mess, "# got '$got'\n",
248 $pass = $got =~ /$expected/;
250 unshift(@mess, "# got '$got'\n",