summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/prism/api/parse_test.rb3
-rw-r--r--test/prism/fixtures/4.0/endless_methods_command_call.txt (renamed from test/prism/fixtures/3.5/endless_methods_command_call.txt)0
-rw-r--r--test/prism/fixtures/4.0/leading_logical.txt (renamed from test/prism/fixtures/3.5/leading_logical.txt)0
-rw-r--r--test/prism/fixtures_test.rb4
-rw-r--r--test/prism/lex_test.rb4
-rw-r--r--test/prism/locals_test.rb4
-rw-r--r--test/prism/ractor_test.rb2
-rw-r--r--test/prism/ruby/parser_test.rb7
-rw-r--r--test/prism/ruby/ripper_test.rb4
-rw-r--r--test/prism/ruby/ruby_parser_test.rb4
-rw-r--r--test/prism/test_helper.rb3
11 files changed, 20 insertions, 15 deletions
diff --git a/test/prism/api/parse_test.rb b/test/prism/api/parse_test.rb
index 1f885fa493..bb1761109f 100644
--- a/test/prism/api/parse_test.rb
+++ b/test/prism/api/parse_test.rb
@@ -119,6 +119,9 @@ module Prism
assert Prism.parse_success?("1 + 1", version: "3.5")
assert Prism.parse_success?("1 + 1", version: "3.5.0")
+ assert Prism.parse_success?("1 + 1", version: "4.0")
+ assert Prism.parse_success?("1 + 1", version: "4.0.0")
+
assert Prism.parse_success?("1 + 1", version: "latest")
# Test edge case
diff --git a/test/prism/fixtures/3.5/endless_methods_command_call.txt b/test/prism/fixtures/4.0/endless_methods_command_call.txt
index 91a9d156d5..91a9d156d5 100644
--- a/test/prism/fixtures/3.5/endless_methods_command_call.txt
+++ b/test/prism/fixtures/4.0/endless_methods_command_call.txt
diff --git a/test/prism/fixtures/3.5/leading_logical.txt b/test/prism/fixtures/4.0/leading_logical.txt
index feb5ee245c..feb5ee245c 100644
--- a/test/prism/fixtures/3.5/leading_logical.txt
+++ b/test/prism/fixtures/4.0/leading_logical.txt
diff --git a/test/prism/fixtures_test.rb b/test/prism/fixtures_test.rb
index 0f0577c10d..2aebb18477 100644
--- a/test/prism/fixtures_test.rb
+++ b/test/prism/fixtures_test.rb
@@ -35,8 +35,8 @@ module Prism
except << "3.3-3.3/return_in_sclass.txt"
# Leaving these out until they are supported by parse.y.
- except << "3.5/leading_logical.txt"
- except << "3.5/endless_methods_command_call.txt"
+ except << "4.0/leading_logical.txt"
+ except << "4.0/endless_methods_command_call.txt"
# https://bugs.ruby-lang.org/issues/21168#note-5
except << "command_method_call_2.txt"
diff --git a/test/prism/lex_test.rb b/test/prism/lex_test.rb
index 9682bf8a32..19dd845d75 100644
--- a/test/prism/lex_test.rb
+++ b/test/prism/lex_test.rb
@@ -43,10 +43,10 @@ module Prism
end
# https://bugs.ruby-lang.org/issues/20925
- except << "3.5/leading_logical.txt"
+ except << "4.0/leading_logical.txt"
# https://bugs.ruby-lang.org/issues/17398#note-12
- except << "3.5/endless_methods_command_call.txt"
+ except << "4.0/endless_methods_command_call.txt"
# https://bugs.ruby-lang.org/issues/21168#note-5
except << "command_method_call_2.txt"
diff --git a/test/prism/locals_test.rb b/test/prism/locals_test.rb
index 439625b750..814c9a9978 100644
--- a/test/prism/locals_test.rb
+++ b/test/prism/locals_test.rb
@@ -38,8 +38,8 @@ module Prism
"3.3-3.3/return_in_sclass.txt",
# Leaving these out until they are supported by parse.y.
- "3.5/leading_logical.txt",
- "3.5/endless_methods_command_call.txt",
+ "4.0/leading_logical.txt",
+ "4.0/endless_methods_command_call.txt",
"command_method_call_2.txt"
]
diff --git a/test/prism/ractor_test.rb b/test/prism/ractor_test.rb
index 6169940beb..0e008ffb08 100644
--- a/test/prism/ractor_test.rb
+++ b/test/prism/ractor_test.rb
@@ -64,7 +64,7 @@ module Prism
else
ractor = ignore_warnings { Ractor.new(*arguments, &block) }
- # Somewhere in the Ruby 3.5.* series, Ractor#take was removed and
+ # Somewhere in the Ruby 4.0.* series, Ractor#take was removed and
# Ractor#value was added.
puts(ractor.respond_to?(:value) ? ractor.value : ractor.take)
end
diff --git a/test/prism/ruby/parser_test.rb b/test/prism/ruby/parser_test.rb
index 3104369d3e..1629c36b38 100644
--- a/test/prism/ruby/parser_test.rb
+++ b/test/prism/ruby/parser_test.rb
@@ -69,10 +69,10 @@ module Prism
"3.4/circular_parameters.txt",
# Cannot yet handling leading logical operators.
- "3.5/leading_logical.txt",
+ "4.0/leading_logical.txt",
- # Ruby >= 3.5 specific syntax
- "3.5/endless_methods_command_call.txt",
+ # Ruby >= 4.0 specific syntax
+ "4.0/endless_methods_command_call.txt",
# https://bugs.ruby-lang.org/issues/21168#note-5
"command_method_call_2.txt",
@@ -172,6 +172,7 @@ module Prism
if RUBY_VERSION >= "3.3"
def test_current_parser_for_current_ruby
major, minor = current_major_minor.split(".")
+ return if major == "3" && minor == "5" # TODO: Remove once ruby-dev becomes 4.0
# Let's just hope there never is a Ruby 3.10 or similar
expected = major.to_i * 10 + minor.to_i
assert_equal(expected, Translation::ParserCurrent.new.version)
diff --git a/test/prism/ruby/ripper_test.rb b/test/prism/ruby/ripper_test.rb
index 12c854aea6..400139acc0 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.
- "3.5/leading_logical.txt",
+ "4.0/leading_logical.txt",
# Ripper incorrectly attributes the block to the keyword.
"seattlerb/block_break.txt",
@@ -40,7 +40,7 @@ module Prism
"3.4/circular_parameters.txt",
# https://bugs.ruby-lang.org/issues/17398#note-12
- "3.5/endless_methods_command_call.txt",
+ "4.0/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 42a888be82..fae5077e20 100644
--- a/test/prism/ruby/ruby_parser_test.rb
+++ b/test/prism/ruby/ruby_parser_test.rb
@@ -84,8 +84,8 @@ module Prism
"3.4/circular_parameters.txt",
- "3.5/endless_methods_command_call.txt",
- "3.5/leading_logical.txt",
+ "4.0/endless_methods_command_call.txt",
+ "4.0/leading_logical.txt",
# https://bugs.ruby-lang.org/issues/21168#note-5
"command_method_call_2.txt",
diff --git a/test/prism/test_helper.rb b/test/prism/test_helper.rb
index faf6117668..c03f70b2cd 100644
--- a/test/prism/test_helper.rb
+++ b/test/prism/test_helper.rb
@@ -230,7 +230,7 @@ module Prism
end
# All versions that prism can parse
- SYNTAX_VERSIONS = %w[3.3 3.4 3.5 4.0]
+ SYNTAX_VERSIONS = %w[3.3 3.4 4.0]
# Returns an array of ruby versions that a given filepath should test against:
# test.txt # => all available versions
@@ -256,6 +256,7 @@ module Prism
if RUBY_VERSION >= "3.3.0"
def test_all_syntax_versions_present
+ return if RUBY_VERSION.start_with?("3.5") # TODO: Remove once ruby-dev becomes 4.0
assert_include(SYNTAX_VERSIONS, current_major_minor)
end
end