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"