summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2020-12-28 10:45:17 +0900
committeraycabta <aycabta@gmail.com>2021-01-05 18:05:06 +0900
commite72a6ed45f6ba844f15523b9f1250c22601c0011 (patch)
tree09f1654b7dc51c2553d0fe7831e6d75d2f76458f /test
parentcce72a24119b5c2177100865f52376ca4b32bd9d (diff)
[ruby/irb] Escape invalid byte sequence in Exception
This fixes ruby/irb#141. https://github.com/ruby/irb/commit/0815317d42
Diffstat (limited to 'test')
-rw-r--r--test/irb/test_raise_no_backtrace_exception.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/irb/test_raise_no_backtrace_exception.rb b/test/irb/test_raise_no_backtrace_exception.rb
index 699990f62d..9babc292cd 100644
--- a/test/irb/test_raise_no_backtrace_exception.rb
+++ b/test/irb/test_raise_no_backtrace_exception.rb
@@ -13,5 +13,13 @@ module TestIRB
raise e
IRB
end
+
+ def test_raise_exception_with_invalid_byte_sequence
+ skip if RUBY_ENGINE == 'truffleruby'
+ bundle_exec = ENV.key?('BUNDLE_GEMFILE') ? ['-rbundler/setup'] : []
+ assert_in_out_err(bundle_exec + %w[-rirb -W0 -e IRB.start(__FILE__) -- -f --], <<~IRB, /StandardError \(A\\xF3B\)/, [])
+ raise StandardError, "A\\xf3B"
+ IRB
+ end
end
end