Skip to content

Commit

Permalink
Restore a pending test for processing a regex with regopt
Browse files Browse the repository at this point in the history
This PR reverts a pending test of rubocop#10432 because jruby/jruby#7113
has been resolved in JRuby 9.3.9.0.

## JRuby 9.3.3.0

`RegexpError` error will occur:

```console
% rbenv local jruby-9.3.3.0
% ruby -e "Regexp.new('\x82', Regexp::NOENCODING)"
RegexpError: invalid multibyte escape: /\x82/
  initialize at org/jruby/RubyRegexp.java:956
         new at org/jruby/RubyClass.java:893
      <main> at -e:1
```

## JRuby 9.3.9.0 and JRuby 9.4.1.0

No errors:

```console
% rbenv local jruby-9.3.9.0
% ruby -e "Regexp.new('\x82', Regexp::NOENCODING)"

% rbenv local jruby-9.4.1.0
% ruby -e "Regexp.new('\x82', Regexp::NOENCODING)"
```
  • Loading branch information
koic committed Feb 8, 2023
1 parent 9ee83ab commit 519adef
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions spec/rubocop/cop/variable_force_spec.rb
Expand Up @@ -28,9 +28,7 @@
end
end

# FIXME: Remove `broken_on: jruby` when JRuby incompatible is resolved:
# https://github.com/jruby/jruby/issues/7113
context 'when processing a regex with regopt', broken_on: :jruby do
context 'when processing a regex with regopt' do
let(:node) { parse_source('/\x82/n =~ "a"').ast }

it 'does not raise an error' do
Expand Down

0 comments on commit 519adef

Please sign in to comment.