summaryrefslogtreecommitdiff
path: root/spec/ruby/language/regexp/grouping_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/language/regexp/grouping_spec.rb')
-rw-r--r--spec/ruby/language/regexp/grouping_spec.rb7
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