diff options
author | Benoit Daloze <eregontp@gmail.com> | 2022-04-25 14:53:54 +0200 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2022-04-25 14:53:54 +0200 |
commit | 45cf4f218728a15eb36d14a6c9912086525f5e3f (patch) | |
tree | 2aa93fadcb904c226f722dde47827098b87a9846 /spec/ruby/shared | |
parent | 6ae81d49b52563a6720d666a6118ffa6e484f398 (diff) |
Update to ruby/spec@3affe1e
Diffstat (limited to 'spec/ruby/shared')
-rw-r--r-- | spec/ruby/shared/rational/to_f.rb | 6 | ||||
-rw-r--r-- | spec/ruby/shared/string/times.rb | 12 |
2 files changed, 6 insertions, 12 deletions
diff --git a/spec/ruby/shared/rational/to_f.rb b/spec/ruby/shared/rational/to_f.rb index 56e0b61d68..472a585daa 100644 --- a/spec/ruby/shared/rational/to_f.rb +++ b/spec/ruby/shared/rational/to_f.rb @@ -7,4 +7,10 @@ describe :rational_to_f, shared: true do Rational(-1, 4).to_f.should eql(-0.25) Rational(-1, -4).to_f.should eql(0.25) end + + it "converts to a Float for large numerator and denominator" do + num = 1000000000000000000000000000000000048148248609680896326399448564623182963452541226153892315137780403285956264146010000000000000000000000000000000000048148248609680896326399448564623182963452541226153892315137780403285956264146010000000000000000000000000000000000048148248609680896326399448564623182963452541226153892315137780403285956264146009 + den = 2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + Rational(num, den).to_f.should == 500.0 + end end diff --git a/spec/ruby/shared/string/times.rb b/spec/ruby/shared/string/times.rb index cd4edf5340..8ca9507570 100644 --- a/spec/ruby/shared/string/times.rb +++ b/spec/ruby/shared/string/times.rb @@ -48,18 +48,6 @@ describe :string_times, shared: true do end end - ruby_version_is ''...'2.7' do - it "always taints the result when self is tainted" do - ["", "OK", MyString.new(""), MyString.new("OK")].each do |str| - str.taint - - [0, 1, 2].each do |arg| - @object.call(str, arg).should.tainted? - end - end - end - end - it "returns a String in the same encoding as self" do str = "\xE3\x81\x82".force_encoding Encoding::UTF_8 result = @object.call(str, 2) |