Skip to content

Commit 3baeff1

Browse files
committed
[GR-17457] Fix MRI test depending on ja_JP.UTF-8 locale
PullRequest: truffleruby/3664
2 parents d1e32df + 6781b5a commit 3baeff1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

ci.jsonnet

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ local part_definitions = {
5959
["set", "-o", "pipefail"],
6060
["ruby", "--version"],
6161
["openssl", "version"],
62+
["locale"],
6263
],
6364

6465
logs+: [

test/mri/tests/irb/test_raise_no_backtrace_exception.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# frozen_string_literal: false
22
require 'test/unit'
3+
# TruffleRuby: with changes from https://github.com/ruby/irb/pull/423
4+
require 'tmpdir' # TruffleRuby: added missing require
35

46
module TestIRB
57
class TestRaiseNoBacktraceException < Test::Unit::TestCase
68
def test_raise_exception
7-
# pend if RUBY_ENGINE == 'truffleruby' # https://github.com/ruby/irb/pull/423
89
bundle_exec = ENV.key?('BUNDLE_GEMFILE') ? ['-rbundler/setup'] : []
910
assert_in_out_err(bundle_exec + %w[-rirb -W0 -e IRB.start(__FILE__) -- -f --], <<-IRB, /Exception: foo/, [])
1011
e = Exception.new("foo")
@@ -23,7 +24,6 @@ def test_raise_exception_with_invalid_byte_sequence
2324
end
2425

2526
def test_raise_exception_with_different_encoding_containing_invalid_byte_sequence
26-
# pend if RUBY_ENGINE == 'truffleruby' # https://github.com/ruby/irb/pull/423
2727
backup_home = ENV["HOME"]
2828
Dir.mktmpdir("test_irb_raise_no_backtrace_exception_#{$$}") do |tmpdir|
2929
ENV["HOME"] = tmpdir
@@ -40,6 +40,8 @@ def raise_euc_with_invalid_byte_sequence
4040
end
4141
env = {}
4242
%w(LC_MESSAGES LC_ALL LC_CTYPE LANG).each {|n| env[n] = "ja_JP.UTF-8" }
43+
# TruffleRuby warns when the locale does not exist
44+
env['TRUFFLERUBYOPT'] = "#{ENV['TRUFFLERUBYOPT']} --log.level=SEVERE" if RUBY_ENGINE == 'truffleruby'
4345
args = [env] + bundle_exec + %W[-rirb -C #{tmpdir} -W0 -e IRB.start(__FILE__) -- -f --]
4446
error = /`raise_euc_with_invalid_byte_sequence': あ\\xFF \(RuntimeError\)/
4547
assert_in_out_err(args, <<~IRB, error, [], encoding: "UTF-8")

0 commit comments

Comments
 (0)