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 f344f3a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/irb/test_context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,8 @@ 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)
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 f344f3a

Please sign in to comment.