diff --git a/test/parse_helper.rb b/test/parse_helper.rb index 1b4f8be7d..9e053717c 100644 --- a/test/parse_helper.rb +++ b/test/parse_helper.rb @@ -79,6 +79,8 @@ def assert_source_range(expect_range, range, version, what) # ) # ~~~ def assert_parses(ast, code, source_maps='', versions=ALL_VERSIONS) + refute_operator(versions, :empty?) + with_versions(versions) do |version, parser| try_parsing(ast, code, parser, source_maps, version) end @@ -160,6 +162,8 @@ def try_parsing(ast, code, parser, source_maps, version) # | ~~~ highlights (0)}) # ~~~ def assert_diagnoses(diagnostic, code, source_maps='', versions=ALL_VERSIONS) + refute_operator(versions, :empty?) + with_versions(versions) do |version, parser| source_file = Parser::Source::Buffer.new('(assert_diagnoses)', source: code) @@ -217,6 +221,8 @@ def assert_diagnoses(diagnostic, code, source_maps='', versions=ALL_VERSIONS) # SINCE_2_4) # ~~~ def assert_diagnoses_many(diagnostics, code, versions=ALL_VERSIONS) + refute_operator(versions, :empty?) + with_versions(versions) do |version, parser| source_file = Parser::Source::Buffer.new('(assert_diagnoses_many)', source: code) @@ -242,6 +248,8 @@ def assert_diagnoses_many(diagnostics, code, versions=ALL_VERSIONS) end def refute_diagnoses(code, versions=ALL_VERSIONS) + refute_operator(versions, :empty?) + with_versions(versions) do |version, parser| source_file = Parser::Source::Buffer.new('(refute_diagnoses)', source: code) @@ -258,6 +266,8 @@ def refute_diagnoses(code, versions=ALL_VERSIONS) end def assert_context(context, code, versions=ALL_VERSIONS) + refute_operator(versions, :empty?) + with_versions(versions) do |version, parser| source_file = Parser::Source::Buffer.new('(assert_context)', source: code) diff --git a/test/test_parser.rb b/test/test_parser.rb index 17efcf870..d67c09873 100644 --- a/test/test_parser.rb +++ b/test/test_parser.rb @@ -2239,7 +2239,7 @@ def test_arg_scope s(:lvar, :var)), %q{def f(var = defined?(var)) var end}, %q{}, - SINCE_2_7 - SINCE_2_1) + SINCE_2_1 - SINCE_2_7) assert_parses( s(:def, :f, @@ -2247,7 +2247,7 @@ def test_arg_scope s(:lvar, :var)), %q{def f(var: defined?(var)) var end}, %q{}, - SINCE_2_7 - SINCE_2_1) + SINCE_2_1 - SINCE_2_7) assert_parses( s(:block, @@ -5721,7 +5721,7 @@ def test_regexp_encoding s(:str, "")), %q{/\xa8/n =~ ""}.dup.force_encoding(Encoding::UTF_8), %{}, - SINCE_3_1 - SINCE_1_9) + SINCE_1_9 - SINCE_3_1) end # @@ -6626,7 +6626,7 @@ def test_parser_bug_198 s(:str, "#")), %q{[/()\\1/, ?#]}, %q{}, - SINCE_3_1 - SINCE_1_9) + SINCE_1_9 - SINCE_3_1) end def test_parser_bug_272 @@ -8160,7 +8160,7 @@ def test_forward_args_invalid [:error, :unexpected_token, { :token => 'tDOT3' }], %q{def foo ...; end}, %q{ ^^^ location}, - SINCE_3_1 - SINCE_2_7) + SINCE_2_7 - SINCE_3_1) end def test_trailing_forward_arg