We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fdc534b commit 61764dcCopy full SHA for 61764dc
1 file changed
language/regexp/encoding_spec.rb
@@ -129,6 +129,10 @@
129
-> { Regexp.new("".force_encoding("US-ASCII"), Regexp::FIXEDENCODING) =~ "\303\251".force_encoding('UTF-8') }.should raise_error(Encoding::CompatibilityError)
130
end
131
132
+ it "raises ArgumentError when trying to match a broken String" do
133
+ s = "\x80".force_encoding('UTF-8')
134
+ -> { s =~ /./ }.should raise_error(ArgumentError, "invalid byte sequence in UTF-8")
135
+ end
136
137
it "computes the Regexp Encoding for each interpolated Regexp instance" do
138
make_regexp = -> str { /#{str}/ }
0 commit comments