1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2019-04-28 23:20:11 +02:00
parent 994833085a
commit 79671ec57e
135 changed files with 4415 additions and 4885 deletions

View file

@ -347,22 +347,20 @@ describe "String#rindex with Regexp" do
lambda { "str".rindex(/../, nil) }.should raise_error(TypeError)
end
with_feature :encoding do
it "returns the reverse character index of a multibyte character" do
"ありがりがとう".rindex("").should == 4
"ありがりがとう".rindex(//).should == 4
end
it "returns the reverse character index of a multibyte character" do
"ありがりがとう".rindex("").should == 4
"ありがりがとう".rindex(//).should == 4
end
it "returns the character index before the finish" do
"ありがりがとう".rindex("", 3).should == 2
"ありがりがとう".rindex(//, 3).should == 2
end
it "returns the character index before the finish" do
"ありがりがとう".rindex("", 3).should == 2
"ありがりがとう".rindex(//, 3).should == 2
end
it "raises an Encoding::CompatibilityError if the encodings are incompatible" do
re = Regexp.new "".encode(Encoding::EUC_JP)
lambda do
"あれ".rindex re
end.should raise_error(Encoding::CompatibilityError)
end
it "raises an Encoding::CompatibilityError if the encodings are incompatible" do
re = Regexp.new "".encode(Encoding::EUC_JP)
lambda do
"あれ".rindex re
end.should raise_error(Encoding::CompatibilityError)
end
end