diff options
author | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-29 16:08:16 +0000 |
---|---|---|
committer | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-29 16:08:16 +0000 |
commit | 3fa5bd38af50fb3d98de0ea51043d73f8d06a24b (patch) | |
tree | d473b71cc6925ee1e17727215e9f9a66e3f24802 /spec/ruby/optional/capi/numeric_spec.rb | |
parent | 1e658d45e1f8dbadab18f9c35b5cfb5a5fec98bf (diff) | |
download | ruby-3fa5bd38af50fb3d98de0ea51043d73f8d06a24b.tar.gz |
Update to ruby/spec@83063a3
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby/optional/capi/numeric_spec.rb')
-rw-r--r-- | spec/ruby/optional/capi/numeric_spec.rb | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/spec/ruby/optional/capi/numeric_spec.rb b/spec/ruby/optional/capi/numeric_spec.rb index ff7880a986..b2f629c1ab 100644 --- a/spec/ruby/optional/capi/numeric_spec.rb +++ b/spec/ruby/optional/capi/numeric_spec.rb @@ -238,7 +238,7 @@ describe "CApiNumericSpecs" do end describe "rb_Integer" do - it "creates a new Integer from a String" do + it "creates an Integer from a String" do i = @s.rb_Integer("8675309") i.should be_kind_of(Integer) i.should eql(8675309) @@ -246,15 +246,29 @@ describe "CApiNumericSpecs" do end describe "rb_ll2inum" do - it "creates a new Fixnum from a small signed long long" do + it "creates a Fixnum from a small signed long long" do i = @s.rb_ll2inum_14() i.should be_kind_of(Fixnum) i.should eql(14) end end + describe "rb_ull2inum" do + it "creates a Fixnum from a small unsigned long long" do + i = @s.rb_ull2inum_14() + i.should be_kind_of(Fixnum) + i.should eql(14) + end + + it "creates a positive Bignum from a negative long long" do + i = @s.rb_ull2inum_n14() + i.should be_kind_of(Bignum) + i.should eql(2 ** (@s.size_of_long_long * 8) - 14) + end + end + describe "rb_int2inum" do - it "creates a new Fixnum from a long" do + it "creates a Fixnum from a long" do i = @s.rb_int2inum_14() i.should be_kind_of(Fixnum) i.should eql(14) @@ -262,13 +276,13 @@ describe "CApiNumericSpecs" do end describe "rb_uint2inum" do - it "creates a new Fixnum from a long" do + it "creates a Fixnum from a long" do i = @s.rb_uint2inum_14() i.should be_kind_of(Fixnum) i.should eql(14) end - it "creates a new Bignum from a negative long" do + it "creates a positive Bignum from a negative long" do i = @s.rb_uint2inum_n14() i.should be_kind_of(Bignum) i.should eql(2 ** (@s.size_of_VALUE * 8) - 14) |