On Thu, 30 Nov 2000, Robert Spier wrote:
> PP> Hmmm.... OS/390 seems to be a bit messed up on this new test.
> PP> With a domain name of FORTE.COM and the additonal bit to tests 4
> PP> and 5 to print out C<# ",$h->name,"\n";> and C<# ",$i->name,"\n";>
> PP> I obtain this new failure on test 4:
>
> PP> $ ./perl lib/net-hostent.t 1..5 ok 1 ok 2 ok 3 not ok 4 #
> PP> localhost.FORTE.COM ok 5 # localhost
>
> PP> would you have any recommendation for that one? Is it within
> PP> spec? If not which spec? Thanks.
>
> That's really strange. Does your net-hostent.t have the regex match
> instead of the eq in it? I think (your) regex version is better - so
> we'll be happy as long as it has /localhost/i in it. It's in
> perl-current at the moment.
>
> Translation: I think it's within spec - but don't see why the current
> code doesn't catch it.
To answer your first question: no I did not have the regular expression
mismatch test in there. I had the original
C<print "not " if $h->name ne "localhost";>.
So with the switch to C<!~ /localhost/i> test now passes:
$ ./perl lib/net-hostent.t
1..5
ok 1
ok 2
ok 3
ok 4 # localhost.FORTE.COM
ok 5 # localhost
I was just wondering if C<$h->name !~ /localhost/i> was too lax in that it
would accept the FQDN and I was wondering if it might have been better to
have written:
print "not " if $h->name ne "localhost" or $h->name ne "LOCALHOST";
but if $h->name eq "localhost.FORTE.COM" is acceptable then as patched the
test seems ok on OS/390 and VMS. Thanks for the reply and it looks like
we won't need to use Jarkko's more extensive regular expression.
Peter Prymmer