From bd1b73b97753faa8dd87104bb79aee4da1e4e8c6 Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Fri, 3 Feb 2023 16:32:03 +0000 Subject: [PATCH] Use a different way to test warning emission The test case was added in https://github.com/ruby/irb/commit/d08ef68d2dfbf041d363f65686d78a937954513c 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 --- test/irb/test_context.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/irb/test_context.rb b/test/irb/test_context.rb index edfe3efba..fd145806c 100644 --- a/test/irb/test_context.rb +++ b/test/irb/test_context.rb @@ -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