New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error expected but not given for str vs num comparison #7961
Comments
From fdjcomp@yahoo.comDear Perl people: I got very puzzled with the following situation: Please see the attached script for an example. under perl at least a warning is produced but in Test::More::cmp_ok the test is simply reported Can somebody explain? Into what trap did I fall? Or is Long live Perl Frederik #<-BEGIN use strict; #a string #a number if ($kstr eq $knum) {print "OP eq OK\n"} else {print if ($kstr == $knum) {print "OP == OK\n"} else {print use Test::More; print "\ncmp_ok 'eq' fails as expected \n"; cmp_ok($kstr, 'eq', $knum, "OP eq OK"); print "\ncmp_ok '==' should give not OK IMHO\n\n"; cmp_ok($kstr, '==', $knum, "OP == OK"); #<-END #########HERE is the bug info as requested perl -v and perlbug -d information follows: #<------------------------------------------------------------------> perl -v produced: Binary build 811 provided by ActiveState Corp. #<----------------------------------------------------------------------------> perlbug -d produced: Flags: Site configuration information for perl v5.8.6: Configured by ActiveState at Mon Dec 13 09:51:32 2004. Summary of my perl5 (revision 5 version 8 subversion Locally applied patches: @INC for perl v5.8.6: Environment for perl v5.8.6: #<-------------------------------------------------------------------> |
From @schwernOn Wed, Jun 08, 2005 at 09:09:14AM -0000, fredaa elder wrote:
Its true because the numification of "23.456 7 /s" is 23.456. Perl tries to
Perl is warning you, "I did the best I can, but its really not a number".
Warnings are turned off inside cmp_ok() for reasons I can't quite remember I've taken over these bugs into Test-Simple. -- |
The RT System itself - Status changed from 'new' to 'open' |
p5p@spam.wizbit.be - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#36217 (status was 'resolved')
Searchable as RT36217$
The text was updated successfully, but these errors were encountered: