summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorAndrew Kane <andrew@chartkick.com>2020-11-24 12:26:02 -0800
committerAndrew Kane <andrew@chartkick.com>2020-11-24 12:26:02 -0800
commit761c03e1938a925ad0553ec614ed7e9d59bbdd19 (patch)
treee38a48f82717656ca0876d34cf5134140a60f214 /spec
parent7ff53479e060475672d34ed94714742f343041e7 (diff)
downloadffi-761c03e1938a925ad0553ec614ed7e9d59bbdd19.tar.gz
Added size_limit? method
Diffstat (limited to 'spec')
-rw-r--r--spec/ffi/pointer_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/ffi/pointer_spec.rb b/spec/ffi/pointer_spec.rb
index 3ddfeb7..4cffb5c 100644
--- a/spec/ffi/pointer_spec.rb
+++ b/spec/ffi/pointer_spec.rb
@@ -228,6 +228,16 @@ describe "Pointer" do
expect(pointer.read_int32).to eq(16909060)
end
end if RUBY_ENGINE != "truffleruby"
+
+ describe "#size_limit?" do
+ it "should not have size limit" do
+ expect(FFI::Pointer.new(0).size_limit?).to be false
+ end
+
+ it "should have size limit" do
+ expect(FFI::Pointer.new(0).slice(0, 10).size_limit?).to be true
+ end
+ end if RUBY_ENGINE != "truffleruby"
end
describe "AutoPointer" do