mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 04:24:23 +00:00
Add test for Ractor safety (#11762)
This commit is contained in:
parent
5f77f9bea6
commit
7e0dac4cb1
Notes:
git
2025-03-23 10:45:41 +00:00
Merged-By: eregon <eregontp@gmail.com>
@ -51,4 +51,19 @@ class TestRbConfig < Test::Unit::TestCase
|
||||
assert_match(/\$\(sitearch|\$\(rubysitearchprefix\)/, val, "#{key} #{bug7823}")
|
||||
end
|
||||
end
|
||||
|
||||
def test_limits_and_sizeof_access_in_ractor
|
||||
assert_separately(["-W0"], <<~'RUBY')
|
||||
r = Ractor.new do
|
||||
sizeof_int = RbConfig::SIZEOF["int"]
|
||||
fixnum_max = RbConfig::LIMITS["FIXNUM_MAX"]
|
||||
[sizeof_int, fixnum_max]
|
||||
end
|
||||
|
||||
sizeof_int, fixnum_max = r.take
|
||||
|
||||
assert_kind_of Integer, sizeof_int, "RbConfig::SIZEOF['int'] should be an Integer"
|
||||
assert_kind_of Integer, fixnum_max, "RbConfig::LIMITS['FIXNUM_MAX'] should be an Integer"
|
||||
RUBY
|
||||
end if defined?(Ractor)
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user