From 87125cb9dc56ed97a5df9439062d17b0316e2bb8 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 18 Aug 2026 08:50:15 +0000 Subject: [PATCH] Omit forwarding parameter tests on JRuby The tests added with the forwarding parameter option call the private parser entry points with the option enabled, but the WebAssembly parser shim JRuby loads deliberately rejects it with NotImplementedError (lib/rbs/wasm/parser.rb), so the JRuby suite has been red since the option merged. Omit those tests on JRuby with omit_on_jruby!, as the suite already does for other C-extension-only paths. The schema check for forwarding parameters moves to its own test case so the default method type schema coverage still runs on JRuby. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01KscuNdoWHSkZx3iLD2XcbZ --- test/rbs/method_type_parsing_test.rb | 12 ++++++++++++ test/rbs/schema_test.rb | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/test/rbs/method_type_parsing_test.rb b/test/rbs/method_type_parsing_test.rb index 59b60abc1..af0c3a493 100644 --- a/test/rbs/method_type_parsing_test.rb +++ b/test/rbs/method_type_parsing_test.rb @@ -83,6 +83,8 @@ def foo: (...) -> void end def test_forwarding_parameter + omit_on_jruby! "The WebAssembly parser does not support forwarding parameter syntax" + parse_method_type_with_forwarding("(...) -> void").tap do |type| assert_equal "(...) -> void", type.to_s assert_instance_of Types::Function::ForwardingParam, type.type.forwarding @@ -100,6 +102,8 @@ def test_forwarding_parameter end def test_forwarding_parameter_with_overload_continuation + omit_on_jruby! "The WebAssembly parser does not support forwarding parameter syntax" + _, declarations = parse_signature_with_forwarding(<<~RBS) class Foo def foo: (...) -> void @@ -113,6 +117,8 @@ def foo: (...) -> void end def test_forwarding_parameter_rejects_nonleading_parameters + omit_on_jruby! "The WebAssembly parser does not support forwarding parameter syntax" + [ "(?String value, ...) -> void", "(*String values, ...) -> void", @@ -127,6 +133,8 @@ def test_forwarding_parameter_rejects_nonleading_parameters end def test_forwarding_parameter_must_be_last + omit_on_jruby! "The WebAssembly parser does not support forwarding parameter syntax" + [ "(..., String) -> void", "(..., ...) -> void", @@ -139,6 +147,8 @@ def test_forwarding_parameter_must_be_last end def test_forwarding_parameter_cannot_have_explicit_block + omit_on_jruby! "The WebAssembly parser does not support forwarding parameter syntax" + [ "(...) { () -> void } -> void", "(...) ?{ () -> void } -> void", @@ -150,6 +160,8 @@ def test_forwarding_parameter_cannot_have_explicit_block end def test_forwarding_parameter_is_not_allowed_in_block_types + omit_on_jruby! "The WebAssembly parser does not support forwarding parameter syntax" + error = assert_raise(RBS::ParsingError) do parse_method_type_with_forwarding("() { (...) -> void } -> void") end diff --git a/test/rbs/schema_test.rb b/test/rbs/schema_test.rb index aedf9ad6a..1120e82c3 100644 --- a/test/rbs/schema_test.rb +++ b/test/rbs/schema_test.rb @@ -120,6 +120,10 @@ def test_method_type_schema JSONValidator.method_type.validate!( parse_method_type("[G] (A a, ?B, *C, d: D, ?e: E e, **f) ?{ (G) -> void } -> String").to_json ) + end + + def test_method_type_schema_with_forwarding_parameter + omit_on_jruby! "The WebAssembly parser does not support forwarding parameter syntax" # Forwarding parameters are only parsed when explicitly enabled source = "(String message, ...) -> void"