1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Show unmatched sequence on failure

This commit is contained in:
Nobuyoshi Nakada 2020-02-07 18:10:36 +09:00
parent 115fec062c
commit b64b0f3433
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -892,7 +892,8 @@ class TestFloat < Test::Unit::TestCase
a = rand a = rand
b = a+rand*1000 b = a+rand*1000
s = (b - a) / 10 s = (b - a) / 10
assert_equal(10, (a...b).step(s).to_a.length) seq = (a...b).step(s)
assert_equal(10, seq.to_a.length, seq.inspect)
end end
assert_equal([1.0, 2.9, 4.8, 6.699999999999999], (1.0...6.8).step(1.9).to_a) assert_equal([1.0, 2.9, 4.8, 6.699999999999999], (1.0...6.8).step(1.9).to_a)