Skip to content

Commit 5265a53

Browse files
committed
Subexp calls work fine with local flags, add spec
closes #27
1 parent 999e3df commit 5265a53

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

spec/lib/js_regex/converter/backreference_converter_spec.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,13 @@
272272
.and keep_matching('ababb', 'acabb')
273273
.and keep_not_matching('ababc', 'acabc')
274274
end
275+
276+
it 'uses the correct local flags / options (those that apply to the target)' do
277+
expect(/(a)(?i)\g<1>/).to\
278+
become(/(a)(a)/)
279+
.and keep_matching('aa')
280+
.and keep_not_matching('aA')
281+
end
275282
end
276283

277284
context 'when handling multiplexed named groups' do

0 commit comments

Comments
 (0)