From 45cf4f218728a15eb36d14a6c9912086525f5e3f Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Mon, 25 Apr 2022 14:53:54 +0200 Subject: Update to ruby/spec@3affe1e --- spec/ruby/shared/rational/to_f.rb | 6 ++++++ spec/ruby/shared/string/times.rb | 12 ------------ 2 files changed, 6 insertions(+), 12 deletions(-) (limited to 'spec/ruby/shared') 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) -- cgit v1.2.3