diff options
author | Benoit Daloze <eregontp@gmail.com> | 2021-03-27 13:02:41 +0100 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2021-03-27 13:02:41 +0100 |
commit | 95d9fe9538441eb57ee6752aa1c5088fc6608e34 (patch) | |
tree | 9a0bb070fd8042b83470f7a0bf9cd462c919c7c0 /spec/ruby/language/regexp | |
parent | 44736a6b7a2b3475db2d05187f33e3c1a7b4b4e5 (diff) |
Update to ruby/spec@fd6eddd
Diffstat (limited to 'spec/ruby/language/regexp')
-rw-r--r-- | spec/ruby/language/regexp/grouping_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/ruby/language/regexp/grouping_spec.rb b/spec/ruby/language/regexp/grouping_spec.rb index 2fecf2d2cb..e2abe71d0d 100644 --- a/spec/ruby/language/regexp/grouping_spec.rb +++ b/spec/ruby/language/regexp/grouping_spec.rb @@ -25,4 +25,11 @@ describe "Regexps with grouping" do -> { Regexp.new("(?<1a>a)") }.should raise_error(RegexpError) -> { Regexp.new("(?<-a>a)") }.should raise_error(RegexpError) end + + it "ignore capture groups in line comments" do + /^ + (a) # there is a capture group on this line + b # there is no capture group on this line (not even here) + $/x.match("ab").to_a.should == [ "ab", "a" ] + end end |