Skip to content

Numeric#step issues #2892

@fmfdias

Description

@fmfdias

Hi everyone,

I've been adding keyword arguments support for the Numeric#step on Rubinius and today I decided to run those specs against jruby 9.0.0.0-pre2. Here's a list of issues I've found on jruby:

  • When calling step with the only float value being used is Float::INFINITY, the results being returned are Fixnums instead of Float
  • When calling step with self and stop as Floats and step as a string, it's raising TypeError instead of ArgumentError. It's trying to convert a float to string. The correct exception is raised when self and stop are Fixnums).
  • When calling step without a block, with self and stop as Floats and step is an numeric string, when calling size on the returned enumerator, a value is returned instead of raising an ArgumentError.
  • When calling step without a block, with self and stop as Floats and step is an alphanumeric string, when calling size on the returned enumerator, Float::INFINITY is returned instead of raising an ArgumentError.
  • When using keyword arguments, and by is 0.0, the values being returned are Fixnums instead of Floats.
  • When calling step with mixed positional and keyword arguments, it ignores the stop, which means it does an infinite loop.

Hope this can help you guys fix it. If you like to check or run these tests check them here: rubinius/rubinius#3356.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions