summaryrefslogtreecommitdiff
path: root/spec/ruby/optional/capi/regexp_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/optional/capi/regexp_spec.rb')
-rw-r--r--spec/ruby/optional/capi/regexp_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/ruby/optional/capi/regexp_spec.rb b/spec/ruby/optional/capi/regexp_spec.rb
index 81844e2a6e..af366e17a2 100644
--- a/spec/ruby/optional/capi/regexp_spec.rb
+++ b/spec/ruby/optional/capi/regexp_spec.rb
@@ -109,4 +109,20 @@ describe "C-API Regexp function" do
thr.join
end
end
+
+ describe "rb_memicmp" do
+ it "returns 0 for identical strings" do
+ @p.rb_memcicmp('Hello', 'Hello').should == 0
+ end
+
+ it "returns 0 for strings which only differ in case" do
+ @p.rb_memcicmp('Hello', 'HELLO').should == 0
+ @p.rb_memcicmp('HELLO', 'Hello').should == 0
+ end
+
+ it "returns the difference between the first non matching characters" do
+ @p.rb_memcicmp('Hello', 'HELLP').should == -1
+ @p.rb_memcicmp('HELLp', 'Hello').should == 1
+ end
+ end
end