summaryrefslogtreecommitdiff
path: root/test/prism/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/prism/ruby')
-rw-r--r--test/prism/ruby/parser_test.rb13
-rw-r--r--test/prism/ruby/ripper_test.rb12
-rw-r--r--test/prism/ruby/ruby_parser_test.rb12
3 files changed, 27 insertions, 10 deletions
diff --git a/test/prism/ruby/parser_test.rb b/test/prism/ruby/parser_test.rb
index 10b5fca5ea..016fda91f0 100644
--- a/test/prism/ruby/parser_test.rb
+++ b/test/prism/ruby/parser_test.rb
@@ -65,11 +65,14 @@ module Prism
# 1.. && 2
"ranges.txt",
+ # https://bugs.ruby-lang.org/issues/20478
+ "3.4/circular_parameters.txt",
+
# Cannot yet handling leading logical operators.
- "leading_logical.txt",
+ "3.5/leading_logical.txt",
# Ruby >= 3.5 specific syntax
- "endless_methods_command_call.txt",
+ "3.5/endless_methods_command_call.txt",
# https://bugs.ruby-lang.org/issues/21168#note-5
"command_method_call_2.txt",
@@ -165,9 +168,9 @@ module Prism
if RUBY_VERSION >= "3.3"
def test_current_parser_for_current_ruby
- major, minor, _patch = Gem::Version.new(RUBY_VERSION).segments
+ major, minor = current_major_minor.split(".")
# Let's just hope there never is a Ruby 3.10 or similar
- expected = major * 10 + minor
+ expected = major.to_i * 10 + minor.to_i
assert_equal(expected, Translation::ParserCurrent.new.version)
end
end
@@ -189,7 +192,7 @@ module Prism
end
def test_it_block_parameter_syntax
- it_fixture_path = Pathname(__dir__).join("../../../test/prism/fixtures/it.txt")
+ it_fixture_path = Pathname(__dir__).join("../../../test/prism/fixtures/3.4/it.txt")
buffer = Parser::Source::Buffer.new(it_fixture_path)
buffer.source = it_fixture_path.read
diff --git a/test/prism/ruby/ripper_test.rb b/test/prism/ruby/ripper_test.rb
index 4916ec8d9d..12c854aea6 100644
--- a/test/prism/ruby/ripper_test.rb
+++ b/test/prism/ruby/ripper_test.rb
@@ -9,7 +9,7 @@ module Prism
# Skip these tests that Ripper is reporting the wrong results for.
incorrect = [
# Not yet supported.
- "leading_logical.txt",
+ "3.5/leading_logical.txt",
# Ripper incorrectly attributes the block to the keyword.
"seattlerb/block_break.txt",
@@ -31,8 +31,16 @@ module Prism
# Ripper fails to understand some structures that span across heredocs.
"spanning_heredoc.txt",
+ "3.3-3.3/block_args_in_array_assignment.txt",
+ "3.3-3.3/it_with_ordinary_parameter.txt",
+ "3.3-3.3/keyword_args_in_array_assignment.txt",
+ "3.3-3.3/return_in_sclass.txt",
+
+ # https://bugs.ruby-lang.org/issues/20478
+ "3.4/circular_parameters.txt",
+
# https://bugs.ruby-lang.org/issues/17398#note-12
- "endless_methods_command_call.txt",
+ "3.5/endless_methods_command_call.txt",
# https://bugs.ruby-lang.org/issues/21168#note-5
"command_method_call_2.txt",
diff --git a/test/prism/ruby/ruby_parser_test.rb b/test/prism/ruby/ruby_parser_test.rb
index ec55e41967..7640ddaf1c 100644
--- a/test/prism/ruby/ruby_parser_test.rb
+++ b/test/prism/ruby/ruby_parser_test.rb
@@ -39,7 +39,6 @@ module Prism
"dos_endings.txt",
"heredocs_with_fake_newlines.txt",
"heredocs_with_ignored_newlines.txt",
- "leading_logical.txt",
"method_calls.txt",
"methods.txt",
"multi_write.txt",
@@ -77,8 +76,15 @@ module Prism
"whitequark/ruby_bug_19281.txt",
"whitequark/slash_newline_in_heredocs.txt",
- # Ruby >= 3.5 specific syntax
- "endless_methods_command_call.txt",
+ "3.3-3.3/block_args_in_array_assignment.txt",
+ "3.3-3.3/it_with_ordinary_parameter.txt",
+ "3.3-3.3/keyword_args_in_array_assignment.txt",
+ "3.3-3.3/return_in_sclass.txt",
+
+ "3.4/circular_parameters.txt",
+
+ "3.5/endless_methods_command_call.txt",
+ "3.5/leading_logical.txt",
# https://bugs.ruby-lang.org/issues/21168#note-5
"command_method_call_2.txt",