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

@ -44,15 +44,13 @@ describe "Regexp#match" do
/(.).(.)/.match("01234", 1).captures.should == ["1", "3"]
end
with_feature :encoding do
it "uses the start as a character offset" do
/(.).(.)/.match("零一二三四", 1).captures.should == ["", ""]
end
it "uses the start as a character offset" do
/(.).(.)/.match("零一二三四", 1).captures.should == ["", ""]
end
it "raises an ArgumentError for an invalid encoding" do
x96 = ([150].pack('C')).force_encoding('utf-8')
lambda { /(.).(.)/.match("Hello, #{x96} world!", 1) }.should raise_error(ArgumentError)
end
it "raises an ArgumentError for an invalid encoding" do
x96 = ([150].pack('C')).force_encoding('utf-8')
lambda { /(.).(.)/.match("Hello, #{x96} world!", 1) }.should raise_error(ArgumentError)
end
end
@ -61,15 +59,13 @@ describe "Regexp#match" do
/(.).(.)/.match("01234", -4).captures.should == ["1", "3"]
end
with_feature :encoding do
it "uses the start as a character offset" do
/(.).(.)/.match("零一二三四", -4).captures.should == ["", ""]
end
it "uses the start as a character offset" do
/(.).(.)/.match("零一二三四", -4).captures.should == ["", ""]
end
it "raises an ArgumentError for an invalid encoding" do
x96 = ([150].pack('C')).force_encoding('utf-8')
lambda { /(.).(.)/.match("Hello, #{x96} world!", -1) }.should raise_error(ArgumentError)
end
it "raises an ArgumentError for an invalid encoding" do
x96 = ([150].pack('C')).force_encoding('utf-8')
lambda { /(.).(.)/.match("Hello, #{x96} world!", -1) }.should raise_error(ArgumentError)
end
end