From 0b7487b44ecc0f95dcc8bfa0fdf7d5915dcc0f8f Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Tue, 12 Mar 2024 23:46:49 -0500 Subject: [PATCH] [ruby/stringio] Various cleanup for JRuby ext (https://github.com/ruby/stringio/pull/85) * Fix compile warnings on latest Java. * Adjust one test for JRuby erroring on bad pos= value. * Replace hard JVM synchronization with a spin lock. * Avoid duplicate reads of state fields where possible. * Remove long-deprecated codepoints, chars, bytes, lines methods. * Mark fcntl as not implemented * Split most of the remaining variable-arity methods. https://github.com/ruby/stringio/commit/31a9d42e6c --- test/stringio/test_stringio.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/stringio/test_stringio.rb b/test/stringio/test_stringio.rb index 8afbcf3545..ae8e845497 100644 --- a/test/stringio/test_stringio.rb +++ b/test/stringio/test_stringio.rb @@ -237,8 +237,9 @@ class TestStringIO < Test::Unit::TestCase def test_write_integer_overflow f = StringIO.new - f.pos = RbConfig::LIMITS["LONG_MAX"] assert_raise(ArgumentError) { + # JRuby errors when setting pos to an out-of-range value + f.pos = RbConfig::LIMITS["LONG_MAX"] f.write("pos + len overflows") } end