Skip to content

Commit

Permalink
Improve encoding error test case
Browse files Browse the repository at this point in the history
The test input IRB currently uses happen to hit a compatibility bug in
TruffleRuby, which has been documented in
oracle/truffleruby#2848

Although it'll eventually be fixed, we can make the test case support TruffleRuby
now by tweaking it just a little bit.

Co-authored-by: Kevin Menard <kevin@nirvdrum.com>
  • Loading branch information
st0012 and nirvdrum committed Feb 3, 2023
1 parent 5c8d3df commit a640715
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/irb/test_context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ def test_evaluate_with_exception
end

def test_evaluate_with_encoding_error_without_lineno
pend if RUBY_ENGINE == 'truffleruby'
assert_raise_with_message(EncodingError, /invalid symbol/) {
@context.evaluate(%q[{"\xAE": 1}], 1)
# TruffleRuby adds 'encoding' in the middle of the message
assert_raise_with_message(EncodingError, /invalid( encoding)? symbol/) {
@context.evaluate(%q[:"\xAE"], 1)
# The backtrace of this invalid encoding hash doesn't contain lineno.
}
end
Expand Down

0 comments on commit a640715

Please sign in to comment.