summaryrefslogtreecommitdiff
path: root/spec/ruby/language/regexp_spec.rb
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2020-08-28 20:26:02 +0200
committerBenoit Daloze <eregontp@gmail.com>2020-08-28 20:26:02 +0200
commitb49307c701911a713cbdb48367833d3661a4880a (patch)
tree75674a3f22bee0b347b3efbbcc160bc7a637b8e3 /spec/ruby/language/regexp_spec.rb
parent3dd63108b0e7551aba76eba85a459b58ec971ccb (diff)
Update to ruby/spec@335eb9b
Diffstat (limited to 'spec/ruby/language/regexp_spec.rb')
-rw-r--r--spec/ruby/language/regexp_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/ruby/language/regexp_spec.rb b/spec/ruby/language/regexp_spec.rb
index ac3f773c49..059428ec69 100644
--- a/spec/ruby/language/regexp_spec.rb
+++ b/spec/ruby/language/regexp_spec.rb
@@ -115,6 +115,12 @@ describe "Literal Regexps" do
/foo.(?<=\d)/.match("fooA foo1").to_a.should == ["foo1"]
end
+ # https://bugs.ruby-lang.org/issues/13671
+ it "raises a RegexpError for lookbehind with specific characters" do
+ r = Regexp.new("(?<!dss)", Regexp::IGNORECASE)
+ -> { r =~ "✨" }.should raise_error(RegexpError)
+ end
+
it "supports (?<! ) (negative lookbehind)" do
/foo.(?<!\d)/.match("foo1 fooA").to_a.should == ["fooA"]
end