Skip to content
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

Failing test in S32-str/numeric.t: trying to convert malformed number in scientific notation dies instead of returning a Failure #5811

Closed
p6rt opened this issue Nov 22, 2016 · 4 comments
Labels
JVM Related to Rakudo-JVM

Comments

@p6rt
Copy link

p6rt commented Nov 22, 2016

Migrated from rt.perl.org#130150 (status was 'resolved')

Searchable as RT130150$

@p6rt
Copy link
Author

p6rt commented Nov 22, 2016

From @usev6

The following code dies with StringIndexOutOfBoundsException on rakudo-j​:

$ ./perl6-j -e '+"120e"'
WARNINGS for -e​:
Useless use of "+" in expression "+\"120e\"" in sink context (line 1)
java.lang.StringIndexOutOfBoundsException​: String index out of range​: 4
  in sub parse-int-frac-exp at gen/jvm/CORE.setting line 30717
  in sub parse-simple-number at gen/jvm/CORE.setting line 30841
  in sub parse-real at gen/jvm/CORE.setting line 30847
  in sub val at gen/jvm/CORE.setting line 30868
  in method Numeric at gen/jvm/CORE.setting line 12738
  in sub prefix​:<+> at gen/jvm/CORE.setting line 10006
  in block <unit> at -e line 1

It is supposed to return a Failure like that​:

$ ./perl6-m -e 'say +"120e" ~~ Failure'
True

It looks like this was introduced with commit cb9df2bd40 (if I revert that commit,
the code works as expected).

I'm going to fudge (skip) the test, since I don't have time to look for a fix
at the moment.

@p6rt
Copy link
Author

p6rt commented Nov 22, 2016

From @zoffixznet

Thanks.

Fixed in rakudo/rakudo@17604e3
Test unfuddged in Raku/roast@2836648

On Mon, 21 Nov 2016 23​:22​:04 -0800, bartolin@​gmx.de wrote​:

The following code dies with StringIndexOutOfBoundsException on
rakudo-j​:

$ ./perl6-j -e '+"120e"'
WARNINGS for -e​:
Useless use of "+" in expression "+\"120e\"" in sink context (line 1)
java.lang.StringIndexOutOfBoundsException​: String index out of range​:
4
in sub parse-int-frac-exp at gen/jvm/CORE.setting line 30717
in sub parse-simple-number at gen/jvm/CORE.setting line 30841
in sub parse-real at gen/jvm/CORE.setting line 30847
in sub val at gen/jvm/CORE.setting line 30868
in method Numeric at gen/jvm/CORE.setting line 12738
in sub prefix​:<+> at gen/jvm/CORE.setting line 10006
in block <unit> at -e line 1

It is supposed to return a Failure like that​:

$ ./perl6-m -e 'say +"120e" ~~ Failure'
True

It looks like this was introduced with commit cb9df2bd40 (if I revert
that commit,
the code works as expected).

I'm going to fudge (skip) the test, since I don't have time to look
for a fix
at the moment.

@p6rt
Copy link
Author

p6rt commented Nov 22, 2016

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Nov 22, 2016

@zoffixznet - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Nov 22, 2016
@p6rt p6rt added the JVM Related to Rakudo-JVM label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JVM Related to Rakudo-JVM
Projects
None yet
Development

No branches or pull requests

1 participant