This commit is contained in:
Koichi Sasada 2021-12-15 00:13:15 +09:00
Родитель 0eafba3610
Коммит 04aab3c259
1 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -1360,19 +1360,20 @@ class TestEnv < Test::Unit::TestCase
def test_huge_value_in_ractor
assert_ractor(<<-"end;")
huge_value = "bar" * 40960
r = Ractor.new do |v|
r = Ractor.new huge_value do |v|
ENV["foo"] = "bar"
#{str_for_yielding_exception_class("ENV['foo'] = v ")}
Ractor.yield ENV["foo"]
end
if /mswin/ =~ RUBY_PLATFORM
#{str_for_assert_raise_on_yielded_exception_class(Errno::EINVAL, "r")}
huge_value, result = r.take
result = r.take
assert_equal("bar", result)
else
exception_class = r.take
assert_equal(NilClass, exception_class)
huge_value, result = r.take
result = r.take
assert_equal(huge_value, result)
end
end;