diff options
author | Benoit Daloze <eregontp@gmail.com> | 2022-01-10 16:29:54 +0100 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2022-01-10 16:29:54 +0100 |
commit | 4053e8ba0d39b688440fedee2ab3fffabcd64312 (patch) | |
tree | 8a29366a09cd159798fada68fb1007a2fece5ec6 /spec/ruby/core/array/pack/shared/float.rb | |
parent | 8abfc106058d09840d13f64e7e87cb7e40c3d6fa (diff) | |
download | ruby-4053e8ba0d39b688440fedee2ab3fffabcd64312.tar.gz |
Update to ruby/spec@226cfdc
Diffstat (limited to 'spec/ruby/core/array/pack/shared/float.rb')
-rw-r--r-- | spec/ruby/core/array/pack/shared/float.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/ruby/core/array/pack/shared/float.rb b/spec/ruby/core/array/pack/shared/float.rb index c6b194007f..ba174a071a 100644 --- a/spec/ruby/core/array/pack/shared/float.rb +++ b/spec/ruby/core/array/pack/shared/float.rb @@ -53,6 +53,14 @@ describe :array_pack_float_le, shared: true do it "encodes a negative Float outside the range of a single precision float" do [-1e150].pack(pack_format).should == "\x00\x00\x80\xff" end + + it "encodes a bignum as a float" do + [2 ** 65].pack(pack_format).should == [(2 ** 65).to_f].pack(pack_format) + end + + it "encodes a rational as a float" do + [Rational(3, 4)].pack(pack_format).should == [Rational(3, 4).to_f].pack(pack_format) + end end describe :array_pack_float_be, shared: true do |