Skip to content

Commit

Permalink
Use a different way to test warning emission
Browse files Browse the repository at this point in the history
The test case was added in d08ef68
to verify that IRB emits Ruby warning as expected.

But the subject it uses relies on CRuby's regexp engine, which isn't always
used in other language implementations, like TruffleRuby. That's why we
ended up skipping TruffleRuby in this test case.

Since the test isn't about regexp itself, we can change the testing subject
and just remove the special condition for TruffleRuby.

Co-authored-by: Kevin Menard <kevin@nirvdrum.com>
  • Loading branch information
st0012 and nirvdrum committed Feb 3, 2023
1 parent 05b65e1 commit bd1b73b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions test/irb/test_context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,9 @@ def test_evaluate_with_encoding_error_without_lineno
}
end

def test_evaluate_with_onigmo_warning
pend if RUBY_ENGINE == 'truffleruby'
assert_warning("(irb):1: warning: character class has duplicated range: /[aa]/\n") do
@context.evaluate('/[aa]/', 1)
def test_evaluate_still_emits_warning
assert_warning("(irb):1: warning: END in method; use at_exit\n") do
@context.evaluate(%q[def foo; END {}; end], 1)
end
end

Expand Down

0 comments on commit bd1b73b

Please sign in to comment.