diff options
Diffstat (limited to 'spec/ruby/language/regexp_spec.rb')
-rw-r--r-- | spec/ruby/language/regexp_spec.rb | 6 |
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 |