ruby/test/prism/fixtures_test.rb
Earlopain 17bcd71e42 [ruby/prism] Clean up test excludes
Mostly not having to list version-specific excludes when testing against ripper/parse.y

Also don't test new syntax additions against the parser gems. The version support
for them may (or may not) be expanded but we shouldn't bother while the ruby version
hasn't even released yet.
(ruby_parser translation is not versioned, so let as is for now)

I also removed excludes that have since been implemented by parse.y

https://github.com/ruby/prism/commit/e5a0221c37
2025-12-02 16:20:43 +00:00

34 lines
1005 B
Ruby

# frozen_string_literal: true
return if RUBY_VERSION < "3.2.0"
require_relative "test_helper"
module Prism
class FixturesTest < TestCase
except = []
if RUBY_VERSION < "3.3.0"
# Ruby < 3.3.0 cannot parse heredocs where there are leading whitespace
# characters in the heredoc start.
# Example: <<~' EOF' or <<-' EOF'
# https://bugs.ruby-lang.org/issues/19539
except << "heredocs_leading_whitespace.txt"
except << "whitequark/ruby_bug_19539.txt"
# https://bugs.ruby-lang.org/issues/19025
except << "whitequark/numparam_ruby_bug_19025.txt"
# https://bugs.ruby-lang.org/issues/18878
except << "whitequark/ruby_bug_18878.txt"
# https://bugs.ruby-lang.org/issues/19281
except << "whitequark/ruby_bug_19281.txt"
end
except << "command_method_call_2.txt"
Fixture.each_for_current_ruby(except: except) do |fixture|
define_method(fixture.test_name) { assert_valid_syntax(fixture.read) }
end
end
end