Skip to content

Commit 87125cb

Browse files
committed
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KscuNdoWHSkZx3iLD2XcbZ
1 parent 3d8ffc4 commit 87125cb

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

test/rbs/method_type_parsing_test.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ def foo: (...) -> void
8383
end
8484

8585
def test_forwarding_parameter
86+
omit_on_jruby! "The WebAssembly parser does not support forwarding parameter syntax"
87+
8688
parse_method_type_with_forwarding("(...) -> void").tap do |type|
8789
assert_equal "(...) -> void", type.to_s
8890
assert_instance_of Types::Function::ForwardingParam, type.type.forwarding
@@ -100,6 +102,8 @@ def test_forwarding_parameter
100102
end
101103

102104
def test_forwarding_parameter_with_overload_continuation
105+
omit_on_jruby! "The WebAssembly parser does not support forwarding parameter syntax"
106+
103107
_, declarations = parse_signature_with_forwarding(<<~RBS)
104108
class Foo
105109
def foo: (...) -> void
@@ -113,6 +117,8 @@ def foo: (...) -> void
113117
end
114118

115119
def test_forwarding_parameter_rejects_nonleading_parameters
120+
omit_on_jruby! "The WebAssembly parser does not support forwarding parameter syntax"
121+
116122
[
117123
"(?String value, ...) -> void",
118124
"(*String values, ...) -> void",
@@ -127,6 +133,8 @@ def test_forwarding_parameter_rejects_nonleading_parameters
127133
end
128134

129135
def test_forwarding_parameter_must_be_last
136+
omit_on_jruby! "The WebAssembly parser does not support forwarding parameter syntax"
137+
130138
[
131139
"(..., String) -> void",
132140
"(..., ...) -> void",
@@ -139,6 +147,8 @@ def test_forwarding_parameter_must_be_last
139147
end
140148

141149
def test_forwarding_parameter_cannot_have_explicit_block
150+
omit_on_jruby! "The WebAssembly parser does not support forwarding parameter syntax"
151+
142152
[
143153
"(...) { () -> void } -> void",
144154
"(...) ?{ () -> void } -> void",
@@ -150,6 +160,8 @@ def test_forwarding_parameter_cannot_have_explicit_block
150160
end
151161

152162
def test_forwarding_parameter_is_not_allowed_in_block_types
163+
omit_on_jruby! "The WebAssembly parser does not support forwarding parameter syntax"
164+
153165
error = assert_raise(RBS::ParsingError) do
154166
parse_method_type_with_forwarding("() { (...) -> void } -> void")
155167
end

test/rbs/schema_test.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ def test_method_type_schema
120120
JSONValidator.method_type.validate!(
121121
parse_method_type("[G] (A a, ?B, *C, d: D, ?e: E e, **f) ?{ (G) -> void } -> String").to_json
122122
)
123+
end
124+
125+
def test_method_type_schema_with_forwarding_parameter
126+
omit_on_jruby! "The WebAssembly parser does not support forwarding parameter syntax"
123127

124128
# Forwarding parameters are only parsed when explicitly enabled
125129
source = "(String message, ...) -> void"

0 commit comments

Comments
 (0)