Issue #14712 has been reported by headius (Charles Nutter).

----------------------------------------
Bug #14712: test_step does not work for implementations with full 64-bit fixnum
https://bugs.ruby-lang.org/issues/14712

* Author: headius (Charles Nutter)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
In test/ruby/test_numeric.rb, in test_step, there's the following logic:

```ruby
assert_operator((0.0).step(bignum.to_f, 1.0).size, :>=, bignum) # may loose precision
```

where bignum is

```
bignum = RbConfig::LIMITS['FIXNUM_MAX'] + 1
```

This test passes in both CRuby and JRuby when using CRuby's "smallest bignum" value of 4611686018427387904.

This test fails in both CRuby and JRuby when using JRuby's "smallest bignum" value of 9223372036854775809.

The failure in JRuby is the same as in CRuby:

```
$ rvm ruby-2.5 do ruby test/mri/runner.rb test/mri/ruby/test_numeric.rb -n test_step
Run options: -n test_step

# Running tests:

[1/1] TestNumeric#test_step = 0.00 s
  1) Failure:
TestNumeric#test_step [/Users/headius/projects/jruby/test/mri/ruby/test_numeric.rb:292]:
Expected 9223372036854775808 to be >= 9223372036854775809.
```

Since we (JRuby) use CRuby's tests largely unmodified, I'd like this one to run successfully. However, hardcoding to the CRuby value would mean we aren't testing the same things  (since that value would use fixnum logic), so I'm not sure the best way to improve this test.



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>